improved prototype: depth first search algorithm implemented, basic step
iteration implemented