last n functions work