A working solution. No parallel processing yet.
Ignore eclipse settings