Modified some codes, further improved performance