Replacing stupid sudo runs with loop