updated for five IMUs and fixed a segfault