updated  to use different modes