Simple Pace Calculator in Javascript (no libraries)