wrapped nest2ring and ring2nest. added tests