Added a control, fixed some broken maths, removed some commented out code. Thinking about getting Angular on the case to break it up