added MARK and fixed the bugs