clean up custom variable sort feature