added a few lines and refund function