slight tweaks to code and test