modified for automation