Improve space detection and move into determine_location