improved matching and opengl