code improved2