complete role function