Change generate_edit_commands() function to generate_blocks().