Reallocation almost works. Bugs exist