Now outputs more stats and works with more versions of the problem
also some bugfixes and performance enhancements