Simplification of the auto-suggest code and adding some comments.