added array utils and fixed some tests