Added numpy vectorization