working impl of newArray
fixed printing of types
removed some old code (and comment code)