added simple constant optimizations