Cleaned up the source code a bit.