Fixed bug in cartesian