implemented automatic blocksize selection