lots of fixes, but still many more to do