gets rid of whitespace and empty sections