added more d3d stuff and cleaned out the lib