eliminated all but the qrand function