diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown
--- a/CHANGELOG.markdown
+++ b/CHANGELOG.markdown
@@ -1,3 +1,7 @@
+0.1.3.0
+-------
+* relax the grammer of OPB/WBO files to allow ommitng spaces at the end of weighted terms.
+
 0.1.2.0
 -------
 * relax the grammer of OPB/WBO files to allow various use of space characters.
diff --git a/pseudo-boolean.cabal b/pseudo-boolean.cabal
--- a/pseudo-boolean.cabal
+++ b/pseudo-boolean.cabal
@@ -2,7 +2,7 @@
 -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                pseudo-boolean
-version:             0.1.2.0
+version:             0.1.3.0
 synopsis:            Reading/Writing OPB/WBO files used in pseudo boolean competition
 description:         Reading\/Writing OPB\/WBO files used in pseudo boolean competition
 homepage:            https://github.com/msakai/pseudo-boolean
diff --git a/src/Data/PseudoBoolean/Attoparsec.hs b/src/Data/PseudoBoolean/Attoparsec.hs
--- a/src/Data/PseudoBoolean/Attoparsec.hs
+++ b/src/Data/PseudoBoolean/Attoparsec.hs
@@ -134,7 +134,7 @@
   w <- integer
   oneOrMoreSpace
   t <- term
-  oneOrMoreSpace
+  zeroOrMoreSpace -- we relax the grammar to allow omitting spaces at the end of <sum>.
   return (w,t)
 
 -- <integer>::= <unsigned_integer> | "+" <unsigned_integer> | "-" <unsigned_integer>
diff --git a/src/Data/PseudoBoolean/Parsec.hs b/src/Data/PseudoBoolean/Parsec.hs
--- a/src/Data/PseudoBoolean/Parsec.hs
+++ b/src/Data/PseudoBoolean/Parsec.hs
@@ -134,7 +134,7 @@
   w <- integer
   oneOrMoreSpace
   t <- term
-  oneOrMoreSpace
+  zeroOrMoreSpace -- we relax the grammar to allow omitting spaces at the end of <sum>.
   return (w,t)
 
 -- <integer>::= <unsigned_integer> | "+" <unsigned_integer> | "-" <unsigned_integer>
diff --git a/test/TestPBFile.hs b/test/TestPBFile.hs
--- a/test/TestPBFile.hs
+++ b/test/TestPBFile.hs
@@ -30,8 +30,10 @@
 
 case_exampleLIN_PBS_file = checkOPBFile "test/samples/example-lin-pbs.opb"
 case_exampleLIN_nohint_file = checkOPBFile "test/samples/example-lin-nohint.opb"
+case_exampleLIN_nospaces_file = checkOPBFile "test/samples/example-lin-nospaces.opb"
 case_exampleWBO1_nohint_file = checkWBOFile "test/samples/example1-nohint.wbo"
 case_exampleWBO1_notop_file = checkWBOFile "test/samples/example1-notop.wbo"
+case_exampleWBO1_nospaces_file = checkWBOFile "test/samples/example1-nospaces.wbo"
 
 case_normalized_1096_cudf_paranoid  = checkOPBFile "test/samples/normalized-1096.cudf.paranoid.opb"
 case_normalized_mds_50_10_4 = checkOPBFile "test/samples/normalized-mds_50_10_4.opb"
diff --git a/test/samples/example-lin-nospaces.opb b/test/samples/example-lin-nospaces.opb
new file mode 100644
--- /dev/null
+++ b/test/samples/example-lin-nospaces.opb
@@ -0,0 +1,10 @@
+* #variable= 5 #constraint= 4
+*
+* this is a dummy instance
+*
+min:1 x2 -1 x3;
+1 x1 +4 x2 -2 x5>=2;
+-1 x1 +4 x2 -2 x5>=+3;
+12345678901234567890 x4 +4 x3>=10;
+* an equality constraint
+2 x2 +3 x4 +2 x1 +3 x5=5;
diff --git a/test/samples/example1-nospaces.wbo b/test/samples/example1-nospaces.wbo
new file mode 100644
--- /dev/null
+++ b/test/samples/example1-nospaces.wbo
@@ -0,0 +1,4 @@
+* #variable= 1 #constraint= 2 #soft= 2 mincost= 2 maxcost= 3 sumcost= 5
+soft:6;
+[2]+1 x1>=1;
+[3]-1 x1>=0;
