Refactored get_corner()