Crucial change made in the structure and implemented a efficient fifo that will be needed by the dfs algorithm