code cleanup
added simple singlethreaded ruby version of stat analysis