added a few tweaks from dev branch