Added simplification of whitespace (still needs more work).