How to have a better search and sort option using the submission data