replaced some expressions with built-in functions.