stdin should be run in a separate thread. Fixes horribly slow simulation