used a for loop instead of running the same four commands five times