Max execution time implemented (required for project contest).
Lame description of the algorithm in latex.