implemented merge feature