add sort by functionality