finished notes on generate target script function