CHANGED:applied sort of polish function