added edge-checking for stability

stable, unstable, alone done