slight change to add item and cleaning up code