You have no any indentation. It's not clear where any of the functions end. If
userN_old
is defined inside a function, only that function can see it. You have to return it. Please, preserve a proper indented code to see what is going on! Thanks