updated code but wrong output