wip: maybe 60% implemented, utterly untested