Specific entity selection

I'm trying to select a random armor stand to move to for a maze generator. Right now I'm running into the issue where it's able to select an armor stand at a diagonal or the second floor up. execute at @s as @e[type=minecraft:armor_stand,tag=node,tag=!visited,distance=3.5..8,sort=random,limit=1] store success storage maze Return int 1 run function boc_structures:maze_forward This is the currently line of code that's trying to select the next armor stand to go to
Continue to help post