Correcting code and eliminate some of the problems