added autocomplete and linting, refactored file