Corrected cleaned up code.