renamed class; added test; fixed expiration calculation