works with negative edge