fixed some issues with the original kokkos implementation