revised monte carlo analyze function to perform class analysis as well as individual analysis