Merge/re-write into goldmine() function