diff --git a/clocks.c b/clocks.c
index ac9aaf5..4b5b0b7 100644
--- a/clocks.c
+++ b/clocks.c
@@ -20,7 +20,7 @@
 static char clk_name[NAME_MAX];
 static int  bold[MAX_LINES];
 
-int init_clock_details(bool dump)
+int init_clock_details(bool dump, int selectedwindow)
 {
 	char *path = debugfs_locate_mpoint();
 	struct stat buf;
@@ -29,7 +29,7 @@
 		strcpy(clk_dir_path, path);
 	else {
 		if (!dump) {
-			create_selectedwindow();
+			create_selectedwindow(selectedwindow);
 			sprintf(clock_lines[0], "Unable to locate debugfs "
 				"mount point. Mount debugfs "
 				"and try again..\n");
@@ -47,7 +47,7 @@
 	//strcpy(clk_dir_path, "/debug/clock"); // Hardcoded for testing..
 	if (stat(clk_dir_path, &buf)) {
 		if (!dump) {
-			create_selectedwindow();
+			create_selectedwindow(selectedwindow);
 			sprintf(clock_lines[0], "Unable to find clock tree"
 				" information at %s.\n", clk_dir_path);
 			print_one_clock(0, clock_lines[0], 1, 0);
diff --git a/display.c b/display.c
index 43db4a4..8b03444 100644
--- a/display.c
+++ b/display.c
@@ -89,7 +89,7 @@
 }
 
 
-void create_windows(void)
+void create_windows(int selectedwindow)
 {
 
 	getmaxyx(stdscr, maxy, maxx);
@@ -114,7 +114,7 @@
 
 }
 
-void create_selectedwindow(void)
+void create_selectedwindow(int selectedwindow)
 {
 	WINDOW *win;
 
@@ -140,7 +140,7 @@
 	refresh();
 }
 
-void show_header(void)
+void show_header(int selectedwindow)
 {
 	int i, j = 0;
 	int curr_pointer = 0;
diff --git a/powerdebug.c b/powerdebug.c
index 26f7767..b92826b 100644
--- a/powerdebug.c
+++ b/powerdebug.c
@@ -18,7 +18,6 @@
 #include "powerdebug.h"
 
 int highlighted_row;
-int selectedwindow = -1;
 
 void usage(void)
 {
@@ -80,6 +79,7 @@
 	bool clocks;
 	bool dump;
 	unsigned int ticktime;
+	int selectedwindow;
 	char *clkarg;
 };
 
@@ -89,6 +89,7 @@
 
 	memset(options, 0, sizeof(*options));
 	options->ticktime = 10;
+	options->selectedwindow = -1;
 
 	while (1) {
 		int optindex = 0;
@@ -101,15 +102,15 @@
 		switch (c) {
 		case 'r':
 			options->regulators = true;
-			selectedwindow = REGULATOR;
+			options->selectedwindow = REGULATOR;
 			break;
 		case 's':
 			options->sensors = true;
-			selectedwindow = SENSOR;
+			options->selectedwindow = SENSOR;
 			break;
 		case 'c':
 			options->clocks = true;
-			selectedwindow = CLOCK;
+			options->selectedwindow = CLOCK;
 			break;
 		case 'p':
 			options->findparent = true;
@@ -151,8 +152,8 @@
 		return -1;
 	}
 
-	if (!options->dump && selectedwindow == -1)
-		selectedwindow = CLOCK;
+	if (!options->dump && options->selectedwindow == -1)
+		options->selectedwindow = CLOCK;
 
 	return 0;
 }
@@ -163,24 +164,24 @@
 {
 	char keychar;
 	int keystroke = getch();
-	int oldselectedwin = selectedwindow;
+	int oldselectedwin = options->selectedwindow;
 
 	if (keystroke == EOF)
 		exit(0);
 
 	if (keystroke == KEY_RIGHT || keystroke == 9)
-		selectedwindow++;
+		options->selectedwindow++;
 
 	if (keystroke == KEY_LEFT || keystroke == 353)
-		selectedwindow--;
+		options->selectedwindow--;
 
-	if (selectedwindow >= TOTAL_FEATURE_WINS)
-		selectedwindow = 0;
+	if (options->selectedwindow >= TOTAL_FEATURE_WINS)
+		options->selectedwindow = 0;
 
-	if (selectedwindow < 0)
-		selectedwindow = TOTAL_FEATURE_WINS - 1;
+	if (options->selectedwindow < 0)
+		options->selectedwindow = TOTAL_FEATURE_WINS - 1;
 
-	if (selectedwindow == CLOCK) {
+	if (options->selectedwindow == CLOCK) {
 		if (keystroke == KEY_DOWN)
 			highlighted_row++;
 		if (keystroke == KEY_UP && highlighted_row > 0)
@@ -189,7 +190,7 @@
 			*findparent_ncurses = true;
 
 		if ((keystroke == 27 || oldselectedwin !=
-		     selectedwindow) && *findparent_ncurses) {
+		     options->selectedwindow) && *findparent_ncurses) {
 			*findparent_ncurses = false;
 			clkname_str[0] = '\0';
 		}
@@ -258,24 +259,25 @@
 		if (!options->dump) {
 			if (firsttime[0])
 				init_curses();
-			create_windows();
-			show_header();
+			create_windows(options->selectedwindow);
+			show_header(options->selectedwindow);
 		}
 
-		if (options->regulators || selectedwindow == REGULATOR) {
+		if (options->regulators || options->selectedwindow == REGULATOR) {
 			read_regulator_info();
 			if (!options->dump) {
-				create_selectedwindow();
+				create_selectedwindow(options->selectedwindow);
 				show_regulator_info(options->verbose);
 			}
 			else
 				print_regulator_info(options->verbose);
 		}
 
-		if (options->clocks || selectedwindow == CLOCK) {
+		if (options->clocks || options->selectedwindow == CLOCK) {
 			int ret = 0;
 			if (firsttime[CLOCK]) {
-				ret = init_clock_details(options->dump);
+				ret = init_clock_details(options->dump,
+							 options->selectedwindow);
 				if (!ret)
 					firsttime[CLOCK] = 0;
 				strcpy(clkname_str, "");
@@ -283,7 +285,7 @@
 			if (!ret && !options->dump) {
 				int hrow;
 
-				create_selectedwindow();
+				create_selectedwindow(options->selectedwindow);
 				if (!findparent_ncurses) {
 					int command = 0;
 
@@ -310,9 +312,9 @@
 			}
 		}
 
-		if (options->sensors || selectedwindow == SENSOR) {
+		if (options->sensors || options->selectedwindow == SENSOR) {
 			if (!options->dump) {
-				create_selectedwindow();
+				create_selectedwindow(options->selectedwindow);
 				print_sensor_header();
 			} else
 				read_and_print_sensor_info(options->verbose);
diff --git a/powerdebug.h b/powerdebug.h
index 9fd18a5..cef5570 100644
--- a/powerdebug.h
+++ b/powerdebug.h
@@ -30,8 +30,6 @@
 
 extern struct regulator_info *regulators_info;
 
-extern int selectedwindow;
-
 extern int numregulators;
 
 extern int init_regulator_ds(void);
@@ -50,7 +48,7 @@
 extern int  read_and_print_clock_info(int verbose, int hrow, int selected);
 extern void print_clock_info(int verbose, int hrow, int selected);
 extern void print_string_val(char *name, char *val);
-extern int  init_clock_details(bool dump);
+extern int  init_clock_details(bool dump, int selectedwindow);
 extern void print_clock_header(void);
 extern void print_one_clock(int line, char *str, int bold, int highlight);
 extern char *debugfs_locate_mpoint(void);
@@ -62,7 +60,7 @@
 extern void init_curses(void);
 extern void fini_curses(void);
 extern void killall_windows(int all);
-extern void show_header(void);
-extern void create_windows(void);
-extern void create_selectedwindow(void);
+extern void show_header(int selectedwindow);
+extern void create_windows(int selectedwindow);
+extern void create_selectedwindow(int selectedwindow);
 extern void show_regulator_info(int verbose);
