My_inject method with if, else conditionals