refactored whitespace, and some other bits and scrips