Complete Code (with contributions from George, Shereen and Reem)