removed one memcpy for each frame