Replaced time consuming endl with \n.