depth variable optimization