First search algorithm implemented
Using the algorithm implemented before
More readable and working algorithm
Better direction modifier