added statement for randomly generated number at beginning