Added stabilization code