merged the code with saqib