for algorithms 1.3