Added expression rewriting
Fixed rewriting
Fixed printing