finished purchase function