added encapsultion for buy resources, refine get_resources method so that it returns a hash map of pairs