function [bools,turnedon,turnedoff] = updateBoolList( bools, newbools, mode )
    switch mode
        case 2
            turnedon = setdiff( newbools, bools );
            turnedoff = setdiff( bools, newbools );
            bools = newbools;
        case 1
            turnedon = setdiff( newbools, bools );
            turnedoff = [];
            bools = union( bools, newbools );
        case -1
            turnedon = [];
            turnedoff = setdiff( bools, newbools );
            bools = setdiff( bools, newbools );
        case 0
            turnedon = setdiff( newbools, bools );
            turnedoff = intersect( newbools, bools );
            bools = setxor( bools, newbools );
    end
end
