added code to functions' stubs