changed program structure