added group parameter reading from input, and output writing