Union operation and few adjustments

Union operation is not effective and needs a rework