more changes to complete function