added parse loops for file input