Sort method works perfectly