create toArray method for display