fixed bug in 'turn' inside num_n_conxtn function
refactored a bunch of functions to move inside of the class