Forgot some square brackets and spent hours figuring it out.
Removed incorrect array for attributes and added a comment making it more explicit that the offsets is an array.