fixed a bug with the partitioning to blocks (+1) in B and F O(n)