Implement rand-int