add isTowerStable function