checkpoint to squash
Major refactoring - broken tests left behind!