simpler file input loop