Implement random wrapper