added personal implementation for arraylist to store discovered nodes