updates to fix swapped x y variables.