added Dvir's changes