minor tweaks to the code