First full implmentation of calculate_current

The current is indeed incrementing with each new call of the function.  There are still a ton of global variables.  This will get worked out as time moves on and  reasonable scheme presents itself.