nit: better to use charAt(0) rather than seach the whole string.