Added search functionality and fixed sorting by column.