change tuple to numpy array for better performance