Fixing predict and solving