added sortMember function