fixed coordinates references in main detect_wall