changed String comparison implementation for better readability