fixing merge() method, but it's still not working properly