Cleaned up the code so it is more readable.