crudely working version