code to generate ECBlocks (needs work) - check EC table