Added the autocomplete functionality and clean up the code