stabalising code