Subtasks and main script