just some basic rendering and wand-tracking code