complete the functions