Added x and y loops to WS