Use C99-style loop variable declaration
Parallelize TOA loop