lots of changes, some fixes, some new bugs