Definition now properly uses scoped environment