Added a class to hold the calculations