first commit
small modify for max(y) ==0 case