Runs for longer than it used to, but seems to have a bug whenever 'realloc' gets called
Fixed compilation error