lots of fixes/changes