rearranged code to support a redraw and update method on a set interval