remved buggy digit calculation