random adjust code