merge changes from local copy, various additions and tweaks