define and register functions