last cycle logic