added pointsets merging function