kotlin new array folding and some printing fixes