added some useful codes.