Added a calculation of mode to FREQUENCIES