test pass but wrong alg
better dice cal alg, now with pattern matching