Modify code to print random number every second