changed input file structure hierarchy, other minor changes, more comments