progress on #137

it's getting pretty hairy!