Sort:  

@andu solved the first part. Try to finish