code improved