remove most static buffers in functions, dest pointers instead