Minor code cleanup, commenting added.