Patched extended main.cpp from parallelized