added more comments
simplified code, removed unused import
adding test for asynchronous spawning