didnt indent code so was putting new code outside of function