Updated gram generation to be n={2,3,4} by default and cleaned up some code