change implementation to use BigDecimal