implemented KM and r_random plotting