trying to get the complete function to work