Implemented calculating functionality