Added sorting to blocks.