making the .inject method from scratch