cleaned up code for cutnode generation