added changes from David Kinder for handling very large blocks