added initial swap x for y functionality