CHANGED:cleaned up sort of codes