Added methods for Quantity.java