Changed trange to use arange instead of linspace