changed block to chunk and minor changes