Revert "using Long instead of Integer for the buffers"

This reverts commit 1140a0209aae84137cba73621d4f7f4e5dc096db.
added some comments