Adding the generic solver code