WORKING - Slight tweaks to code