function defs first