added automatic reallocation, morton sorting