Changed output format and added easy switch between x and y output