small bincount correction
changed structure a bit and added machine learning :)