writing output on new lines