Modified to be generic enough for Mac/Windows usage
Added a few comments