change in parsefilesindir method and added iteratefiles method