added base for new version with improved adaptive algorithm and gathering statistics