final code and brief