I fix my former code, so this is the final. Kunjia Liu