outputing to file also