code commenting and cleanup