reduced memory footprint by conditionally loading Tk