Added function to set node numbers and made some variables internal