added c as a parameter of mode