still working on unwanted and misplaced newlines