Implemented calculate method