Defined the variables and calculations