now compiles, kernel still broken (need to step through and straighten out array indexing)