Final solution to re-writing inject challenge