Me rewriting (a limited version of) the inject method