Final UAI version. Added changes based on feedback form stephen and nakul.