tried to implement the code
merge