Changed code to print on console