rewrite of the entire thing
Fixes etc.