newLine functionality with minimum changes