add unit tests for even number of elements, single, and empty