Code refactor

Major code changes, all draw modes now working correctly.