Changed loop determining largest height for #9