bad work, but saving it here, maybe it would be useful
reverted to c70157db92c23707a220198dcf36b8e6d94193b5
not the best commit ever, but it seems work and needs to complete some TODOs