modify script for deep