Added block functions for write and read