A few functions to work quickly on arrays and other stuff