working on mode A