Uh pretty simple, just walk.
I can’t understand the code rn so it might take me a long time but here ya go.