Updated Purchase and selling history code.