updates back from the main branch, fixed bugs and changed how raw arrays are stored