Added in filtering and sorting, readded tests