optimizations of TAIL programs