can't figure out where is the problem in printing arrays?