Fixed tables and added seemingly working Purchase functions