replaced some expressions with built-in functions.
Merge pull request #177 from guoci/patch1

replaced some expressions with built-in functions.