Solving for unknown variables in equations