Solving for height and length