Polling the buffer works, calling java func from native impl every time buffers get swapped

messy code