rewrote function as decl & expr