blocksize has to be at least 1 so it works
removed debug output & some comments