Adjusted tempo calculation. Outputting tempo value for debugging.