add negative weights (fixes #5)