Wrapped the qrand logic and added a few extra features.