saving code used for the SPIE software demo