added more comments, fixed search function for expired jobs