general logic implemented. can create a figure with no duplicates