Efficient inventory control for imperfect quality items