Fixed the coordinate system in Java. It was going (y,x) now it is (x,y)