Made changes to the codes