Working code with changed task bit field. Added functions to set and reset task flag.
Changed whole code to work with task_t variable.
Changed the Control Modes to a single Bit Field
Control modes called properly now