copied code from bdi to scl90