WPF canvas program using monte carlo simulation to calculate Pi