modify tests according to new code
rewrite the algorithm that finds AFE
modify tests according to new code
reformat code
rewrite the algorithm that finds ALE