replace function with fn composition.
replace a whole lot of frequency calc code with... frequencies :)