fixed draw command bug, and renamed some vars