Task 5 Improvements

I made some minor tweaks to the code