updated freq algorithm
actually committed correctly and updated freq analysis alg