Implemented logic for dividing tasks. Usage channels instead arrays