added solution for str_cmp function