main script for a task