using .inject method