a few tweaks and bugs