created a random generator struct, to be passed to generator
added some ifndef macros to header files
UpdateZ and UpdateQ now use a random state
now init state is only on start