Adding write_block method (untested)