some invertel dp code