add getNextBlock, and getFirstFreeBlock