worked on mthe useItem function