Updated with a flag for specifying block size