Cleaned up source code and moved things around.