finish the function for mix-up