further a little modify on qx qy calculation