Added new method to write in console