Added ToArray method