refactored design to use numpy arrays