fix #34

not ready yet, looking for early review (haven't done any manual or unit testing.)