cannot get loop to print out