added arrayhelper function for sorting multi-dimensional arrays