added degenerate case