Purchase functionality implemented [NOT TESTED]