program 3 updated script; still needs tie breaking