Final fully functional source code for parallelization