calc logic implementations