Fixed file writing problem
Added test cases, fixed problem getting correct comment for a file
Added comment