Final version of homework4. This time it passes all tests with GOMAXPROCS=4