Commenting and code cleanup