vectorized the numpy practice functions