complet the function