Update to use new API
Switch data structure based on algorithm choice