array-to-vector seems to be working properly now
some tidying up / commenting
tidy types
more tidying
fix 1057 bug leaving lots of tidy up for train :-)