Simplify
Fix whitespace
Initial work on tests