updated output so it prints on the same line