Added code to getBPM().
Implemented file extension filter.
Optimized scan code.