Verified memory safety, valgrinded a bit, added some commentation, added small remove character function