fixed and extended upgrade test and algorithm