updated custom functions