figures out the equation