Algorithms for exam from PAL