Added modified script, sample input and output