added the function for merging places, bug fixes