tinkering around, putting this code here because having no clue where else to put it. might need a repo called attic some time...