added strlen, strncpy and realloc