restructure program to add intersection