Implementing the calc method