added comments for the makeFile function. Some name refactoring for better readability.