determining when to replace