added Bob's suggestion; fixed tests