Added modes function.