adding purchases and linking tables