added file MAD_with_time.m