allocating memory for sets