Adding sort to main JS