modified nodemodel initializer to handle dimension