merged the code