scripts for frequency analysis