add writeBlockData method