Debugged swap coordinates