polish calculations logic