A more general solution