changed type for indizes to long, cilk todo