solved in generality