added function runn to run a task n times sequentially