added version using sets