Plank script rewrite to use an array