auto complete working
cleaned up code