code commenting and clean up