Changed the path argument from directory_iterator to string, as nothing in this function relied on the functionality.