Start adding sorting back in. incomplete