switched array logic to numpy dot product