updated file structure, supports multiple inputs