Almost done still need to modify cost to include discount and failure rate