some useful code.