Implementation of MC method for comparison