created randon number generator method