cleaned up add item function