make dictionary a set instead of array
updated methods to work with dictionary set