replaced with state tuned code to test