refactor to use parellel arrays