Issue #9: Modified random to work with indexes instead of deleting positions in the array