Fixed memory bug with realloc
Added -g flag for debugging with gdb