Implementation of Bonus mechanism (Ashlagi&Roth). Small changes in lib.R