made all calculations into global variables

Function calculations need work