fixed bugs and added features for bigdecimal