Improved implementation of past check and added performance test past check