got the sorting done and the connection to the jsp