now passing the variable name around instead of assuming obj.
added support for dependency on a schema for the dependencies