implemented number_of_rounds algorithm