Minor tweaks to working version