add Language Model, fixed logic error in test()