perfect the code