MOre tweaks to code