Completed the BPM calculation and UI