Code improved