updatet program logic