crude implementation to test out sync.waitgroup