Can you check my code is giving me a wrong output