working version
update: there is one bug: pool is of size cores, but there are (core + 1) pool.submit calls
fix number of pool.submit calls