Coordinate indeces correctly switched. Test cases ok.-