gen script is functional