First draft of convert_blocks_to_agp.pl