changed searchById() to find() and added hash map constructor to purchase