Pieces of code,maybe useful.