Made the program work as desired.