with extra credit on bad wait
with extra credit on bad exit
fixed merge conflicts