several bug fixes
code seems to be bug-free. stuff is working. i can go to sleep