Fix for results tending to zero
Refactored to use calc global variable
Refactored to reflect key pressings