Added conversion to cartesian coordinates and textfile output.