Updated according  to latest changes.