Changed second comparison in unite function