Rewriting the inject method and creating a takeaway programme