updates sorting stuff