Code Cleanup

Added more comments for readability