fixing problems and adding sort info