implemented sorting and working on searching