Tried to reduce the amount of concurrentmodificationexceptions the program causes. Still requires testing.