back to single threaded version
dynamic allocation