refactoring
refactoring
to merge with leif's stuff
removal of style and refactor notes from leif