Fixed documentation and removed duplicate code from merge.