implement some functions