added monte-carlo, and debuged