implement the IBM model1 with java