fixing calculations and reactivating unit tests