added rand option