use prev and cur to keep track of status