Fixed the calc method

Changed the entire method so it should compile now. I hope.