add functions and closure