I think all that needs to be done is to swap the if and elif here.