Solving for heights and lengths