made an example using for that uses the array param. Examine it for inspiration for allocNew.