added logic for triple
fixed ending for nine innings