Using sets instead of arrays