changed serial code a bit
refactored the concurrent solution