bugfix: 0 - w (w != 0) is actually negative