function rewriting