added toArray method to datamapper