Added readblock and writeblock functions.