implemented some functions