Implemented a possible sorting solution. We will need to write our own custom sorting function in order to get the exact results we want.