Solving for unknown variables in proportions