buy/undo functionality added