Added expanding function, successor nodes and closed nodes