bugfix: moved allocation of big arrays on the heap