Vh/bugfix/structured arrays v2

Alteranative to #22 for clsoing #16 

Still segfaults on my box though.