Sort:  

Mistake is in the 2nd last line now try to find out yourself