Updated ruby script and added an output file