updated code so old examples work.