Added code to more quickly calulate things