changed mc algorithm so that it uses powers of 2 for N and will not reuse older samples.
Also avoided the use of np.matrix() and used np.ndarray() as much as possible.