realigned a few lines of code and changed input varible in if statement for new items