add manual encoding for block struct