branching off (mostly)working version
it works 95%
5am: glorious victory