Now correctly works with blocks of different brightness.