code improved for realese