use numpy for random operations
break compatibility with Python 2.6