Fixed a couple of bugs and created methods to calculate the numbers.