added fave sorting function