There are some typos and stuff in here, and opts is undefined.