adding final merge logic and options