Correct timing error in calculation
Fix speed issue