Useful IDL code