added more thought into monte carlo method