removed extra uncessary loop in cartesian.