start of fixes
somewhat functional
merge into master
Merge branch 'master' into new_fixes