Initial commit of function code