Working code for completed set