touched up the code