move 'tasks' to global, and create itoa function to print int