fixed statement tree generation