rename some things, allow buffer to be passed in addAttribute