sorting through the data by type working