fixed bug with indexing (more than 256 values in the buffer)
implemented scrolling