Simplify code.  Use distinct method on string rather than manual implementation.