code cleaning, fixed modes index