move towards desired output
fix empty last line bug