some useful simple code