Add some comments, general cleanup.