Trying to recreate a small portion of functions in string.h