implementing equations and calculations