finished random and MC exercises