A few tweaks to code