Readded saving traces after bugfix
Included java.io.*
Modified the output file