working on the monte Carlo simulation