Final version submitted for UAI