added static_cast to DrawFunction and deleted unused variables