final submission, x and y axis switched, all working and tested