modified for mahout