deal with arrays type
some tidy up of code failing to compile