added yield implementation of inject along with corresponding tests