helps to return coords in right order