added loop feature to file.