initially cloned from Mallet