separate old new algorithm again. add bucketing
some bug fixes