wrote the realEstate function, which abstracts the code for PurchaseLocation and SellLocation