fixed a little error during the compiling, :-)
added initialization values on all variables, please check the initialization of state (). I worked a bit on the tree without so much success :-(