Small code cleanup. Added some comments.