fixed whitespace, organised code