Comments update

Changed the filename in the header-comment
Added explanatory comments about some things
Addes test to make sure that cwd is not null