indexing: changing Hashsets to Arraylists to reduce non-determinism