Now passing an object from the parent scope to circumvent some scope issues.