keep original code from Mallet