my attempt at re creating the inject method