improved coding style
changed outputfile addressing