some jshint pleasing
added comments for final functionality
added some semi colons