Implemented calulation.