implementation calculate