Revised all code to follow proper coding practices.