clean up the code, still not green