fixed python3 problem with range as iterator (use arange instead)