implement my_inject method