better algo for making blocks