add check for nodes at the origin, change max to min
code that hopefully actually works this time
fixing logic on checking for real nodes
fixing me being dumb
change lists to tuples