completed some functions