final code for comp