Added comments to each file in the project excluding dirent.h which can probably be removed. Also did a small amount of refactoring. Code should be fairly clean now.