MALLET functions overhaul