added read block function