finished first function for string library