Block Generation Code.