adding sorting and rating