Correcting some errors and rewriting some functions.