some common useful codes