Updated the sortContainer functions
Add the tests