Cleaned/formatted some of the code.