added some more functionality about modes