modified to code to start using samples which are modified ray buffers