improved library sum