Code Cleanup and Commenting