Improved write and read to work with multiple blocks