test function for updateGram