added insert into select plan code. still not quite working.