ok, started my thoughts, but need to go for now https://gist.github.com/445adc206d51a038de4a