add stats and clean up source files