The only problem with the current implementation and would presumably also happen with @maddalab 's  implementation is that when there are no notes at all, notes comes back null and then this causes a NullPointerException within Arrays.copyOf!