finished, still a few valgrind errors because apparently i don't understand realloc but whatever.