frequency calculation now accurate