figured out mdoublearrays. very messy