code for various string manipulation, sorting and matching algorithms