made changes to db schema, and sorting feature working