Use file system events to detect file changes.
Use file system events to detect file renames.
Clean up if statement.
Better method for handling removed files.
Move determining index to own function.