New version off code that works. Buffer is tested and works flawless!