roughly imprementation of string comparison