adding the updated version of the codes