added Yaron's fixes