slowly implementing the Walker's algorithm