Now the code is 500% faster. Testing on different histogram bug configurations