crazy amount of debug code... and maybe fixed the get buf problem