first working version
ConcurrentModificationException needs to be fixed