removed for loop delaying action of program