Solving for the length of a rectangle