Added sortchest function (incomplete)