Add quadric solver function