finally fixed referring to nodes by ints instead of strings