Added transform smoothing and output file writing