implmenet some functions