modification to get rid of negative A(w)