Re-wrote ore data structure, fixing #4