added an early sorting method
doesnt work so well, it fills the inventory with duplicates of everythingx27 every time you do it until you crash from out of bounds error