implemented sorting on the backend