Adding code to parent and child programs