Some changes from @ruler501's manual team control