cleanup and code commenting