corrected input files and minor bug fix