adding my modification to qy's apweb paper