diff --git a/src/smap/Makefile.am b/src/smap/Makefile.am
index 52ae2f209cb0e6b74e8ae276c70b39632ccc4c67..cd894cc4a23cde05187adf2aad61ff3eadfe9f59 100644
--- a/src/smap/Makefile.am
+++ b/src/smap/Makefile.am
@@ -12,8 +12,8 @@ smap_LDADD =					  \
 	$(top_builddir)/src/common/libcommon.la   \
 	$(top_builddir)/src/api/libslurm.la
 
-noinst_HEADERS = smap.h print.h printjob.h
-smap_SOURCES = smap.c opts.c print.c printjob.c sort.c sortjob.c
+noinst_HEADERS = smap.h 
+smap_SOURCES = smap.c opts.c
 
 force:
 $(smap_LDADD) : force
diff --git a/src/smap/opts.c b/src/smap/opts.c
index 34821cb492056d5a2a3bb9a8e6c3298dfa681f8d..0cc60cea46e9a0c55876bf689382ca2b3f3c1123 100644
--- a/src/smap/opts.c
+++ b/src/smap/opts.c
@@ -42,8 +42,6 @@
 #include <unistd.h>
 
 #include "src/common/xstring.h"
-#include "src/smap/print.h"
-#include "src/smap/printjob.h"
 #include "src/smap/smap.h"
 
 /* getopt_long options, integers but not characters */
@@ -52,20 +50,9 @@
 #define OPT_LONG_HIDE	0x102
 
 /* FUNCTIONS */
-static List  _build_job_list( char* str );
-static List  _build_state_list( char* str );
-static List  _build_all_states_list( void );
-static char *_get_prefix(char *token);
-static void  _help( void );
-//static int   parse_format( char* );
-static bool  _node_state_equal (int state_id, const char *state_str);
-static int   _node_state_id (char *str);
-static const char * _node_state_list (void);
-static void  _parse_token( char *token, char *field, int *field_size, 
-                           bool *right_justify, char **suffix);
-static void  _print_options( void );
-static void  _print_version( void );
-static void  _usage( void );
+static void _help(void);
+static void _print_version(void);
+static void _usage(void);
 
 /*
  * parse_command_line, fill in params data structure with data
@@ -75,898 +62,129 @@ extern void parse_command_line(int argc, char *argv[])
 	char *env_val = NULL;
 	int opt_char;
 	int option_index;
-	int tmp=0;
+	int tmp = 0;
 	static struct option long_options[] = {
-		{"all",         no_argument,       0, 'a'},
-		{"dead",      no_argument,       0, 'd'},
-		{"Display",   required_argument, 0, 'D'},
-		{"exact",     no_argument,       0, 'e'},
-		{"noheader",  no_argument,       0, 'h'},
-		{"iterate",   required_argument, 0, 'i'},
-		{"jobs",      optional_argument, 0, 'j'},
-		{"long",      no_argument,       0, 'l'},
-		{"nodes",     required_argument, 0, 'n'},
-		{"Node",      no_argument,       0, 'N'},
-		{"format",    required_argument, 0, 'o'},
-		{"partition", required_argument, 0, 'p'},
-		{"responding",no_argument,       0, 'r'},
-		{"list-reasons", no_argument,    0, 'R'},
-		{"summarize", no_argument,       0, 's'},
-		{"sort",      required_argument, 0, 'S'},
-		{"states",    required_argument, 0, 't'},
-		{"verbose",   no_argument,       0, 'v'},
-		{"version",   no_argument,       0, 'V'},
-		{"help",      no_argument,       0, OPT_LONG_HELP},
-		{"usage",     no_argument,       0, OPT_LONG_USAGE},
-		{"hide",     no_argument, 0, OPT_LONG_HIDE},
-		{NULL,        0,                 0, 0}
+		{"display", required_argument, 0, 'D'},
+		{"noheader", no_argument, 0, 'h'},
+		{"iterate", required_argument, 0, 'i'},
+		{"long", no_argument, 0, 'l'},
+		{"sort", required_argument, 0, 'S'},
+		{"version", no_argument, 0, 'V'},
+		{"help", no_argument, 0, OPT_LONG_HELP},
+		{"usage", no_argument, 0, OPT_LONG_USAGE},
+		{"hide", no_argument, 0, OPT_LONG_HIDE},
+		{NULL, 0, 0, 0}
 	};
 
 	if (getenv("SMAP_ALL"))
 		params.all_flag = true;
-	if ( ( env_val = getenv("SMAP_FORMAT") ) ) 
+	if ((env_val = getenv("SMAP_FORMAT")))
 		params.format = xstrdup(env_val);
-	if ( ( env_val = getenv("SMAP_PARTITION") ) )
+	if ((env_val = getenv("SMAP_PARTITION")))
 		params.partition = xstrdup(env_val);
-	if ( ( env_val = getenv("SMAP_SORT") ) )
+	if ((env_val = getenv("SMAP_SORT")))
 		params.sort = xstrdup(env_val);
 
 
-	while((opt_char = getopt_long(argc, argv, "adD:ehi:j:ln:No:p:rRsS:t:vV",
-				      long_options, &option_index)) != -1) {
-	  switch (opt_char) {
-	  case (int)'?':
-	    fprintf(stderr, "Try \"smap --help\" for more information\n");
-	    exit(1);
-	    break;
-	  case (int)'a':
-	    params.all_flag = true;
-	    break;
-	  case (int)'d':
-	    params.dead_nodes = true;
-	    break;
-	  case (int)'D':
-	    if(!strcmp(optarg,"j"))
-	      tmp = JOBS;
-	    else if(!strcmp(optarg,"s"))
-	      tmp = SLURMPART;
-	    else if(!strcmp(optarg,"b"))
-	      tmp = BGLPART;
-	      
-	    params.Display = tmp;
-	    break;
-	  case (int)'e':
-	    params.exact_match = true;
-	    break;
-	  case (int)'h':
-	    params.no_header = true;
-	    break;
-	  case (int) 'i':
-	    params.iterate= atoi(optarg);
-	    if (params.iterate <= 0) {
-	      error ("Error: --iterate=%s");
-	      exit(1);
-	    }
-	    break;
-	  case (int) 'j':
-	    if (optarg) {
-	      params.jobs = xstrdup(optarg);
-	      params.job_list = 
-		_build_job_list(params.jobs);
-	    }
-	    params.job_flag = true;
-	    break;	
-	  case (int) 'l':
-	    params.long_output = true;
-	    break;
-	  case (int) 'n':
-	    params.nodes= xstrdup(optarg);
-	    break;
-	  case (int) 'N':
-	    params.node_flag = true;
-	    break;
-	  case (int) 'o':
-	    params.format = xstrdup(optarg);
-	    break;
-	  case (int) 'p':
-	    xfree(params.partition);
-	    params.partition = xstrdup(optarg);
-	    break;
-	  case (int) 'r':
-	    params.responding_nodes = true;
-	    break;
-	  case (int) 'R':
-	    params.list_reasons = true;
-	    break;
-	  case (int) 's':
-	    params.summarize = true;
-	    break;
-	  case (int) 'S':
-	    xfree(params.sort);
-	    params.sort = xstrdup(optarg);
-	    break;
-	  case (int) 't':
-	    params.states = xstrdup(optarg);
-	    if (!(params.state_list = _build_state_list(optarg))) {
-	      error ("valid states: %s", _node_state_list ());
-	      exit (1);
-	    }
-	    break;
-	  case (int) 'v':
-	    params.verbose++;
-	    break;
-	  case (int) 'V':
-	    _print_version();
-	    exit(0);
-	  case (int) OPT_LONG_HELP:
-	    _help();
-	    exit(0);
-	  case (int) OPT_LONG_USAGE:
-	    _usage();
-	    exit(0);
-	  case OPT_LONG_HIDE:
-	    params.all_flag = false;
-	    break;
-	  }
-	}
-	
-	if(params.Display==SLURMPART)
-	  {
-	    if ( params.format == NULL ) {
-	      if ( params.summarize ) {
-		params.format = "%9P %.5a %.9l %.15F  %N";
-		
-	      } else if ( params.node_flag ) {
-		params.node_field_flag = true;	/* compute size later */
-		params.format = params.long_output ?
-		  "%N %.5D %.9P %.11T %.4c %.6m %.8d %.6w %.8f %20R" :
-		  "%N %.5D %.9P %6t";
-		
-	      } else if (params.list_reasons) {
-		params.format = params.long_output ?  
-		  "%35R %6t %N" : 
-		  "%35R %N";
-		
-	      } else if ((env_val = getenv ("SMAP_FORMAT"))) {
-		params.format = xstrdup(env_val);
-		
-	      } else {
-		params.format = params.long_output ? 
-		  "%9P %.5a %.9l %.8s %.4r %.5h %.10g %.5D %.11T %N" :
-		  "%9P %.5a %.9l %.5D %.6t %N";
-	      }
-	    }
-	    
-	    parse_format( params.format );
-	    
-	    if (params.list_reasons && (params.state_list == NULL)) {
-	      params.states = xstrdup ("down,drain,draining");
-	      if (!(params.state_list = _build_state_list (params.states)))
-		fatal ("Unable to build state list for -R!");
-	    }
-	    
-	    if (params.dead_nodes || params.nodes || params.partition || 
-		params.responding_nodes ||params.state_list)
-	      params.filtering = true;
-	    
-	    if (params.verbose)
-	      _print_options();
-	  }
-	else if(params.Display==JOBS)
-	  {
-	    if (params.format == NULL) {
-	      if (params.long_output)
-		params.format = "%.7i %.9P %.8j %.8u %.8T %.10M %.9l "
-		  "%.6D %R";
-	      else
-		params.format = "%.7i %.9P %.8j %.8u  %.2t %.10M %.6D %R";
-	    }
-
-	  }
-}
-
-static char *
-_next_tok (char *sep, char **str)
-{
-	char *tok;
-
-        /* push str past any leading separators */
-        while ((**str != '\0') && (strchr(sep, **str) != '\0'))
-                (*str)++;
-
-        if (**str == '\0')
-                return NULL;
-
-        /* assign token ptr */
-        tok = *str;
-
-        /* push str past token and leave pointing to first separator */
-        while ((**str != '\0') && (strchr(sep, **str) == '\0'))
-                (*str)++;
-
-        /* nullify consecutive separators and push str beyond them */
-        while ((**str != '\0') && (strchr(sep, **str) != '\0'))
-                *(*str)++ = '\0';
-
-        return (tok);
-}
-
-/*
- * _build_state_list - build a list of job states
- * IN str - comma separated list of job states
- * RET List of enum job_states values
- */
-static List 
-_build_state_list (char *state_str)
-{
-	List state_ids;
-	char *orig, *str, *state;
-
-	if (state_str == NULL)
-		return NULL;
-	if (strcasecmp (state_str, "all") == 0 )
-		return _build_all_states_list ();
-
-	orig = str = xstrdup (state_str);
-	state_ids = list_create (NULL);
-
-	while ((state = _next_tok (",", &str))) {
-		int *id = xmalloc (sizeof (*id));
-		if ((*id = _node_state_id (state)) < 0) {
-			error ("Bad state string: \"%s\"", state);
-			return (NULL);
+	while ((opt_char =
+		getopt_long(argc, argv, "D:hi:lS:V",
+			    long_options, &option_index)) != -1) {
+		switch (opt_char) {
+		case (int) '?':
+			fprintf(stderr,
+				"Try \"smap --help\" for more information\n");
+			exit(1);
+			break;
+		case (int) 'D':
+			if (!strcmp(optarg, "j"))
+				tmp = JOBS;
+			else if (!strcmp(optarg, "s"))
+				tmp = SLURMPART;
+			else if (!strcmp(optarg, "b"))
+				tmp = BGLPART;
+
+			params.display = tmp;
+			break;
+		case (int) 'h':
+			params.no_header = true;
+			break;
+		case (int) 'i':
+			params.iterate = atoi(optarg);
+			if (params.iterate <= 0) {
+				error("Error: --iterate=%s");
+				exit(1);
+			}
+			break;
+		case (int) 'l':
+			params.long_output = true;
+			break;
+		case (int) 'S':
+			xfree(params.sort);
+			params.sort = xstrdup(optarg);
+			break;
+		case (int) 'V':
+			_print_version();
+			exit(0);
+		case (int) OPT_LONG_HELP:
+			_help();
+			exit(0);
+		case (int) OPT_LONG_USAGE:
+			_usage();
+			exit(0);
+		case OPT_LONG_HIDE:
+			params.all_flag = false;
+			break;
 		}
-		list_append (state_ids, id);
-	}
-
-	xfree (orig);
-	return (state_ids);
-}
-
-/*
- * _build_all_states_list - build a list containing all possible job states
- * RET List of enum job_states values
- */
-static List 
-_build_all_states_list( void )
-{
-	List my_list;
-	int i;
-	uint16_t *state_id;
-
-	my_list = list_create( NULL );
-	for (i = 0; i<NODE_STATE_END; i++) {
-		state_id = xmalloc( sizeof( uint16_t ) );
-		*state_id = (uint16_t) i;
-		list_append( my_list, state_id );
 	}
-	return my_list;
-}
 
-static const char *
-_node_state_list (void)
-{
-	int i;
-	static char *all_states = NULL; 
+	if (params.display == SLURMPART) {
+		if (params.long_output)
+			params.format =
+			    "%9P %.5a %.9l %.8s %.4r %.5h %.10g %.5D %.11T %N";
+		else
+			params.format = "%9P %.5a %.9l %.5D %.6t %N";
+
+	} else if (params.display == JOBS) {
+		if (params.long_output)
+			params.format =
+			    "%.7i %.9P %.8j %.8u %.8T %.10M %.9l %.6D %R";
+		else
+			params.format =
+			    "%.7i %.9P %.8j %.8u  %.2t %.10M %.6D %R";
+
+	} else {
+		if (params.long_output)
+			params.format =
+			    "%9P %.5a %.9l %.8s %.4r %.5h %.10g %.5D %.11T %N";
+		else
+			params.format = "%9P %.5a %.9l %.5D %.6t %N";
 
-	if (all_states) return (all_states);
-
-	all_states = xstrdup (node_state_string_compact (0));
-	for (i = 1; i < NODE_STATE_END; i++) {
-		xstrcat (all_states, ",");
-		xstrcat (all_states, node_state_string_compact(i));
 	}
-
-	for (i = 0; i < strlen (all_states); i++)
-		all_states[i] = tolower (all_states[i]);
-
-	return (all_states);
 }
 
 
-static bool
-_node_state_equal (int i, const char *str)
-{
-	int len = strlen (str);
-
-	if (  (strncasecmp (node_state_string_compact(i), str, len) == 0) 
-	   || (strncasecmp (node_state_string(i),         str, len) == 0)) 
-		return (true);
-
-	return (false);
-}
-
-/*
- * _parse_state - convert node state name string to numeric value
- * IN str - state name
- * OUT states - node_state value corresponding to str
- * RET 0 or error code
- */
-static int 
-_node_state_id (char *str)
-{	
-  int i;
-  for (i = 0; i < NODE_STATE_END; i++) {
-    if (_node_state_equal (i, str))
-      return (i);
-  }
-  
-  return (-1);
-}
-
-/* 
- * parse_format_jobs - Take the user's format specification and use it to build 
- *	build the format specifications (internalize it to print.c data 
- *	structures) 
- * IN format - user's format specification
- * RET zero or error code
- */
-extern int parse_format_jobs( char* format )
-{
-  int field_size;
-  bool right_justify;
-  char *prefix, *suffix, *token, *tmp_char, *tmp_format;
-  char field[1];
-  
-  if (format == NULL) {
-    error ("Format option lacks specification.");
-    exit( 1 );
-  }
-  
-  params.format_list = list_create( NULL );
-  if ((prefix = _get_prefix(format))) {
-    if (params.step_flag)
-      step_format_add_prefix( params.format_list, 0, 0, 
-			      prefix); 
-    else
-      job_format_add_prefix( params.format_list, 0, 0, 
-			     prefix);
-  }
-  
-  field_size = strlen( format );
-  tmp_format = xmalloc( field_size + 1 );
-  strcpy( tmp_format, format );
-  
-  token = strtok_r( tmp_format, "%", &tmp_char);
-  if (token && (format[0] != '%'))	/* toss header */
-    token = strtok_r( NULL, "%", &tmp_char );
-  while (token) {
-    _parse_token( token, field, &field_size, &right_justify, 
-		  &suffix);
-    if (params.step_flag) {
-      if      (field[0] == 'i')
-	step_format_add_id( params.format_list, 
-			    field_size, 
-			    right_justify, suffix );
-      else if (field[0] == 'M')
-	step_format_add_time_used( params.format_list, 
-				   field_size, 
-				   right_justify, 
-				   suffix );
-      else if (field[0] == 'N')
-	step_format_add_nodes( params.format_list, 
-			       field_size, 
-			       right_justify, suffix );
-      else if (field[0] == 'P')
-	step_format_add_partition( params.format_list, 
-				   field_size, 
-				   right_justify, 
-				   suffix );
-      else if (field[0] == 'S')
-	step_format_add_time_start( params.format_list, 
-				    field_size, 
-				    right_justify, 
-				    suffix );
-      else if (field[0] == 'U')
-	step_format_add_user_id( params.format_list, 
-				 field_size, 
-				 right_justify, 
-				 suffix );
-      else if (field[0] == 'u')
-	step_format_add_user_name( params.format_list, 
-				   field_size, 
-				   right_justify, 
-				   suffix );
-      else
-	error ("Invalid job step format specification: %c",
-	       field[0] );
-    } else {
-      if (field[0] == 'a')
-	job_format_add_account( params.format_list,
-				field_size,
-				right_justify,
-				suffix  );
-      else if (field[0] == 'b')
-	job_format_add_time_start( params.format_list, 
-				   field_size, 
-				   right_justify, 
-				   suffix  );
-      else if (field[0] == 'c')
-	job_format_add_min_procs( params.format_list, 
-				  field_size, 
-				  right_justify, 
-				  suffix  );
-      else if (field[0] == 'C')
-	job_format_add_num_procs( params.format_list, 
-				  field_size, 
-				  right_justify, 
-				  suffix  );
-      else if (field[0] == 'd')
-	job_format_add_min_tmp_disk( params.format_list,
-				     field_size, 
-				     right_justify, 
-				     suffix  );
-      else if (field[0] == 'D')
-	job_format_add_num_nodes( params.format_list,
-				  field_size, 
-				  right_justify, 
-				  suffix  );
-      else if (field[0] == 'e')
-	job_format_add_time_end( params.format_list, 
-				 field_size, 
-				 right_justify, 
-				 suffix );
-      else if (field[0] == 'E')
-	job_format_add_dependency( params.format_list,
-				   field_size,
-				   right_justify,
-				   suffix );
-      else if (field[0] == 'f')
-	job_format_add_features( params.format_list, 
-				 field_size, 
-				 right_justify, 
-				 suffix );
-      else if (field[0] == 'G')
-	job_format_add_group_id( params.format_list,
-				 field_size,
-				 right_justify,
-				 suffix );
-      else if (field[0] == 'g')
-	job_format_add_group_name( params.format_list,
-				   field_size,
-				   right_justify,
-				   suffix );
-      else if (field[0] == 'h')
-	job_format_add_shared( params.format_list, 
-			       field_size, 
-			       right_justify, 
-			       suffix );
-      else if (field[0] == 'i')
-	job_format_add_job_id( params.format_list, 
-			       field_size, 
-			       right_justify, 
-			       suffix );
-      else if (field[0] == 'j')
-	job_format_add_name( params.format_list, 
-			     field_size, 
-			     right_justify, suffix );
-      else if (field[0] == 'l')
-	job_format_add_time_limit( params.format_list, 
-				   field_size, 
-				   right_justify, 
-				   suffix );
-      else if (field[0] == 'm')
-	job_format_add_min_memory( params.format_list, 
-				   field_size, 
-				   right_justify, 
-				   suffix );
-      else if (field[0] == 'M')
-	job_format_add_time_used( params.format_list, 
-				  field_size, 
-				  right_justify, 
-				  suffix );
-      else if (field[0] == 'n')
-	job_format_add_req_nodes( params.format_list, 
-				  field_size, 
-				  right_justify, 
-				  suffix );
-      else if (field[0] == 'N')
-	job_format_add_nodes( params.format_list, 
-			      field_size, 
-			      right_justify, suffix );
-      else if (field[0] == 'o')
-	job_format_add_num_nodes( params.format_list, 
-				  field_size, 
-				  right_justify, 
-				  suffix );
-      else if (field[0] == 'O')
-	job_format_add_contiguous( params.format_list, 
-				   field_size, 
-				   right_justify, 
-				   suffix );
-      else if (field[0] == 'p')
-	job_format_add_priority( params.format_list, 
-				 field_size, 
-				 right_justify, 
-				 suffix );
-      else if (field[0] == 'P')
-	job_format_add_partition( params.format_list, 
-				  field_size, 
-				  right_justify, 
-				  suffix );
-      else if (field[0] == 'r')
-	job_format_add_reason( params.format_list,
-			       field_size,
-			       right_justify,
-			       suffix );
-      else if (field[0] == 'R')
-	job_format_add_reason_list(  params.format_list,
-				     field_size,
-				     right_justify,
-				     suffix );
-			else if (field[0] == 'S')
-			  job_format_add_time_start( params.format_list, 
-						     field_size, 
-						     right_justify, 
-						     suffix );
-      else if (field[0] == 't')
-	job_format_add_job_state_compact( 
-					 params.format_list, 
-							field_size, 
-					 right_justify, 
-					 suffix );
-      else if (field[0] == 'T')
-	job_format_add_job_state( params.format_list, 
-				  field_size, 
-				  right_justify, 
-				  suffix );
-      else if (field[0] == 'U')
-	job_format_add_user_id( params.format_list, 
-				field_size, 
-				right_justify, 
-				suffix );
-      else if (field[0] == 'u')
-	job_format_add_user_name( params.format_list, 
-				  field_size, 
-				  right_justify, 
-				  suffix );
-      else if (field[0] == 'x')
-	job_format_add_exc_nodes( params.format_list, 
-				  field_size, 
-				  right_justify, 
-				  suffix );
-      else 
-	error( "Invalid job format specification: %c", 
-	       field[0] );
-    }
-    token = strtok_r( NULL, "%", &tmp_char);
-  }
-  
-  xfree( tmp_format );
-  return SLURM_SUCCESS;
-}
-
-/* Take the user's format specification and use it to build build the 
- *	format specifications (internalize it to print.c data structures) */
-extern int 
-parse_format( char* format )
-{
-	int field_size;
-	bool right_justify;
-	char *prefix, *suffix, *token, *tmp_char, *tmp_format;
-	char field[1];
-
-	if (format == NULL) {
-		fprintf( stderr, "Format option lacks specification\n" );
-		exit( 1 );
-	}
-
-	params.format_list = list_create( NULL );
-	if ((prefix = _get_prefix(format)))
-		format_add_prefix( params.format_list, 0, 0, prefix); 
-
-	tmp_format = xstrdup( format );
-	token = strtok_r( tmp_format, "%", &tmp_char);
-	if (token && (format[0] != '%'))	/* toss header */
-		token = strtok_r( NULL, "%", &tmp_char );
-	while (token) {
-		_parse_token( token, field, &field_size, &right_justify, 
-			      &suffix);
-		if (field[0] == 'a') {
-			params.match_flags.avail_flag = true;
-			format_add_avail( params.format_list,
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'A') {
-			format_add_nodes_ai( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'b') {
-		  job_format_add_time_start( params.format_list, 
-					     field_size, 
-					     right_justify, 
-					     suffix  );
-		} else if (field[0] == 'c') {
-			params.match_flags.cpus_flag = true;
-			format_add_cpus( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'd') {
-			params.match_flags.disk_flag = true;
-			format_add_disk( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'D') {
-			format_add_nodes( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'f') {
-			params.match_flags.features_flag = true;
-			format_add_features( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'F') {
-			format_add_nodes_aiot( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'g') {
-			params.match_flags.groups_flag = true;
-			format_add_groups( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'h') {
-			params.match_flags.share_flag = true;
-			format_add_share( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'l') {
-			params.match_flags.max_time_flag = true;
-			format_add_time( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'm') {
-			params.match_flags.memory_flag = true;
-			format_add_memory( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'N') {
-			format_add_node_list( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'P') {
-			params.match_flags.partition_flag = true;
-			format_add_partition( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'r') {
-			params.match_flags.root_flag = true;
-			format_add_root( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'R') {
-			params.match_flags.reason_flag = true;
-			format_add_reason( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 's') {
-			params.match_flags.job_size_flag = true;
-			format_add_size( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 't') {
-			params.match_flags.state_flag = true;
-			format_add_state_compact( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'T') {
-			params.match_flags.state_flag = true;
-			format_add_state_long( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else if (field[0] == 'w') {
-			params.match_flags.weight_flag = true;
-			format_add_weight( params.format_list, 
-					field_size, 
-					right_justify, 
-					suffix );
-		} else
-			fprintf(stderr, "Invalid node format specification: %c\n", 
-			        field[0] );
-		token = strtok_r( NULL, "%", &tmp_char);
-	}
-
-	xfree( tmp_format );
-	return SLURM_SUCCESS;
-}
-
-/* Take a format specification and copy out it's prefix
- * IN/OUT token - input specification, everything before "%" is removed
- * RET - everything before "%" in the token
- */
-static char *
-_get_prefix( char *token )
-{
-	char *pos, *prefix;
-
-	if (token == NULL) 
-		return NULL;
-
-	pos = strchr(token, (int) '%');
-	if (pos == NULL)	/* everything is prefix */
-		return xstrdup(token);
-	if (pos == token)	/* no prefix */
-		return NULL;
-
-	pos[0] = '\0';		/* some prefix */
-	prefix = xstrdup(token);
-	pos[0] = '%';
-	memmove(token, pos, (strlen(pos)+1));
-	return prefix;
-}
-
-/* Take a format specification and break it into its components
- * IN token - input specification without leading "%", eg. ".5u"
- * OUT field - the letter code for the data type
- * OUT field_size - byte count
- * OUT right_justify - true of field to be right justified
- * OUT suffix - tring containing everthing after the field specification
- */
-static void
-_parse_token( char *token, char *field, int *field_size, bool *right_justify, 
-	      char **suffix)
-{
-	int i = 0;
-
-	assert (token != NULL);
-
-	if (token[i] == '.') {
-		*right_justify = true;
-		i++;
-	} else
-		*right_justify = false;
-
-	*field_size = 0;
-	while ((token[i] >= '0') && (token[i] <= '9'))
-		*field_size = (*field_size * 10) + (token[i++] - '0');
-
-	field[0] = token[i++];
-
-	*suffix = xstrdup(&token[i]);
-}
-
-/*
- * _build_job_list- build a list of job_ids
- * IN str - comma separated list of job_ids
- * RET List of job_ids (uint32_t)
- */
-static List 
-_build_job_list( char* str )
-{
-	List my_list;
-	char *job, *tmp_char, *my_job_list;
-	int i;
-	uint32_t *job_id;
-
-	if ( str == NULL)
-		return NULL;
-	my_list = list_create( NULL );
-	my_job_list = xstrdup( str );
-	job = strtok_r( my_job_list, ",", &tmp_char );
-	while (job) 
-	{
-		i = strtol( job, (char **) NULL, 10 );
-		if (i <= 0) {
-			error( "Invalid job id: %s", job );
-			exit( 1 );
-		}
-		job_id = xmalloc( sizeof( uint32_t ) );
-		*job_id = (uint32_t) i;
-		list_append( my_list, job_id );
-		job = strtok_r (NULL, ",", &tmp_char);
-	}
-	return my_list;
-}
-
-/* print the parameters specified */
-void _print_options( void )
-{
-	printf("-----------------------------\n");
-	printf("dead        = %s\n", params.dead_nodes ? "true" : "false");
-	printf("exact       = %d\n", params.exact_match);
-	printf("filtering   = %s\n", params.filtering ? "true" : "false");
-	printf("format      = %s\n", params.format);
-	printf("iterate     = %d\n", params.iterate );
-	printf("long        = %s\n", params.long_output ? "true" : "false");
-	printf("no_header   = %s\n", params.no_header   ? "true" : "false");
-	printf("node_field  = %s\n", params.node_field_flag ? 
-					"true" : "false");
-	printf("node_format = %s\n", params.node_flag   ? "true" : "false");
-	printf("nodes       = %s\n", params.nodes ? params.nodes : "n/a");
-	printf("partition   = %s\n", params.partition ? 
-					params.partition: "n/a");
-	printf("responding  = %s\n", params.responding_nodes ?
-					"true" : "false");
-	printf("states      = %s\n", params.states);
-	printf("sort        = %s\n", params.sort);
-	printf("summarize   = %s\n", params.summarize   ? "true" : "false");
-	printf("verbose     = %d\n", params.verbose);
-	printf("-----------------------------\n");
-	printf("all_flag        = %s\n", params.all_flag ? "true" : "false");
-	printf("avail_flag      = %s\n", params.match_flags.avail_flag ?
-			"true" : "false");
-	printf("cpus_flag       = %s\n", params.match_flags.cpus_flag ?
-			"true" : "false");
-	printf("disk_flag       = %s\n", params.match_flags.disk_flag ?
-			"true" : "false");
-	printf("features_flag   = %s\n", params.match_flags.features_flag ?
-			"true" : "false");
-	printf("groups_flag     = %s\n", params.match_flags.groups_flag ?
-					"true" : "false");
-	printf("job_size_flag   = %s\n", params.match_flags.job_size_flag ?
-					"true" : "false");
-	printf("max_time_flag   = %s\n", params.match_flags.max_time_flag ?
-					"true" : "false");
-	printf("memory_flag     = %s\n", params.match_flags.memory_flag ?
-			"true" : "false");
-	printf("partition_flag  = %s\n", params.match_flags.partition_flag ?
-			"true" : "false");
-	printf("reason_flag     = %s\n", params.match_flags.reason_flag ?
-			"true" : "false");
-	printf("root_flag       = %s\n", params.match_flags.root_flag ?
-			"true" : "false");
-	printf("share_flag      = %s\n", params.match_flags.share_flag ?
-			"true" : "false");
-	printf("state_flag      = %s\n", params.match_flags.state_flag ?
-			"true" : "false");
-	printf("weight_flag     = %s\n", params.match_flags.weight_flag ?
-			"true" : "false");
-	printf("-----------------------------\n\n");
-}
-
 
 static void _print_version(void)
 {
 	printf("%s %s\n", PACKAGE, SLURM_VERSION);
 }
 
-static void _usage( void )
+static void _usage(void)
 {
 	printf("\
 Usage: smap [-adelNRrsv] [-i seconds] [-t states] [-p partition] [-n nodes]\n\
              [-S fields] [-o format] \n");
 }
 
-static void _help( void )
+static void _help(void)
 {
-	printf ("\
+	printf("\
 Usage: smap [OPTIONS]\n\
-  -a, --all                  show all partitions (including hidden and those\n\
-                             not accessible)\n\
-  -d, --dead                 show only non-responding nodes\n\
-  -D, --Display              set which Display mode to use (j=jobs, s=slurm partitions, b=BG/L partitions)\n\
-  -e, --exact                group nodes only on exact match of configuration\n\
+  -D, --display              set which Display mode to use (j=jobs, s=slurm partitions, b=BG/L partitions)\n\
   -h, --noheader             no headers on output\n\
-  -hide                      do not show hidden or non-accessible partitions\n\
   -i, --iterate=seconds      specify an interation period\n\
   -l, --long                 long output - displays more information\n\
-  -n, --nodes=NODES          report on specific node(s)\n\
-  -N, --Node                 Node-centric format\n\
-  -o, --format=format        format specification\n\
-  -p, --partition=PARTITION  report on specific partition\n\
-  -r, --responding           report only responding nodes\n\
-  -R, --list-reasons         list reason nodes are down or drained\n\
-  -s, --summarize            report state summary only\n\
   -S, --sort=fields          comma seperated list of fields to sort on\n\
-  -t, --states=node_state    specify the what states of nodes to view\n\
-  -v, --verbose              verbosity level\n\
   -V, --version              output version information and exit\n\
 \nHelp options:\n\
   --help                     show this help message\n\
diff --git a/src/smap/smap.c b/src/smap/smap.c
index 5617b528bd1cf5de691b628aebefbaf2d861d38c..b0aea9e06b7f2d6a64f4b53597a7ee321b948d10 100644
--- a/src/smap/smap.c
+++ b/src/smap/smap.c
@@ -1,5 +1,5 @@
 /*****************************************************************************\
- *  smap.c - Report overall state the system
+ *  smap.c - -*- linux-c -*- Report overall state the system
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -28,699 +28,544 @@
 #include "src/common/xstring.h"
 #include "src/common/macros.h"
 #include "src/smap/smap.h"
-#include "src/smap/print.h"
-#include "src/smap/printjob.h"
 
 /********************
  * Global Variables *
  ********************/
 struct smap_parameters params;
 int quiet_flag = 0;
-int max_line_size;
 int xcord = 1;
 int ycord = 1;
 WINDOW *grid_win;
 WINDOW *text_win;
+time_t now;
+axis grid[X][Y][Z];
+axis fill_in_value[num_of_proc];
 
 /************
  * Functions *
  ************/
 static void _init_window(WINDOW * win);
-static void _init_grid( void );
-static void _print_grid( void );
-static void  _init_grid( void );
-static int  _get_window_width( void );
-static void _print_job (void);
-static int  _build_smap_data(List smap_list, 
-		partition_info_msg_t *partition_msg,
-		node_info_msg_t *node_msg);
-static void _create_smap(List smap_list, partition_info_t* part_ptr, 
-		uint16_t part_inx, node_info_t *node_ptr);
-static bool _filter_out(node_info_t *node_ptr);
-static void _smap_list_delete(void *data);
-static partition_info_t *_find_part(char *part_name, 
-		partition_info_msg_t *partition_msg, uint16_t *part_inx);
-static bool _match_node_data(smap_data_t *smap_ptr, 
-                             node_info_t *node_ptr);
-static bool _match_part_data(smap_data_t *smap_ptr, 
-                             partition_info_t* part_ptr);
-static int  _query_server(partition_info_msg_t ** part_pptr,
-		node_info_msg_t ** node_pptr);
-static void _sort_hostlist(List smap_list);
-static int  _strcmp(char *data1, char *data2);
-static void _update_smap(smap_data_t *smap_ptr, 
-		partition_info_t* part_ptr, node_info_t *node_ptr);
+static void _init_grid(void);
+static void _print_grid(void);
+static void _init_grid(void);
+static void _get_job(void);
+static void _get_part(void);
+static int _print_job(job_info_t * job_ptr);
+static int _print_part(partition_info_t * part_ptr);
+void print_date(void);
+void print_header_part(void);
+void print_header_job(void);
+int set_grid_bgl(int startx, int starty, int startz, int endx, int endy,
+		 int endz, int count);
+int set_grid(int start, int end, int count);
 
 int main(int argc, char *argv[])
 {
-  log_options_t opts = LOG_OPTS_STDERR_ONLY;
-  partition_info_msg_t *partition_msg = NULL;
-  node_info_msg_t *node_msg = NULL;
-  List smap_list = NULL;
-  
-  char ch;
-  
-  int height = Y*Z+Y*2;
-  int width = X*2;
-  int startx = 0;
-  int starty = 0;
-  int end = 0;
-  int i;
-
-  log_init(xbasename(argv[0]), opts, SYSLOG_FACILITY_DAEMON, NULL);
-  parse_command_line(argc, argv);
-  max_line_size = _get_window_width( );
-  initscr();
-  raw();
-  keypad(stdscr,TRUE);
-  noecho();
-  cbreak();
-  curs_set(1);
-  nodelay(stdscr, TRUE);
-  start_color();
-  
-  grid_win = newwin(height, width, starty, startx);
-  box(grid_win,0,0);
-  
-  startx = width;
-  width = COLS - width;  
-  height = LINES;
-  text_win = newwin(height, width, starty, startx);
-  box(text_win,0,0);
-  
-  while (!end) {
-    ch = getch();
-    switch(ch)
-      {
-      case 'q':
-      case '\n':
+	log_options_t opts = LOG_OPTS_STDERR_ONLY;
+
+	char ch;
+
+	int height = Y * Z + Y * 2;
+	int width = X * 2;
+	int startx = 0;
+	int starty = 0;
+	int end = 0;
+	int i;
+
+	log_init(xbasename(argv[0]), opts, SYSLOG_FACILITY_DAEMON, NULL);
+	parse_command_line(argc, argv);
+	initscr();
+	raw();
+	keypad(stdscr, TRUE);
+	noecho();
+	cbreak();
+	curs_set(1);
+	nodelay(stdscr, TRUE);
+	start_color();
+
+	grid_win = newwin(height, width, starty, startx);
+	box(grid_win, 0, 0);
+
+	startx = width;
+	width = COLS - width;
+	height = LINES;
+	text_win = newwin(height, width, starty, startx);
+	box(text_win, 0, 0);
+
+	while (!end) {
+		ch = getch();
+		switch (ch) {
+		case 'b':
+			params.display = BGLPART;
+			break;
+		case 's':
+			params.display = SLURMPART;
+			break;
+		case 'j':
+			params.display = JOBS;
+			break;
+		case 'q':
+		case '\n':
+			endwin();
+			exit(0);
+			break;
+		}
+	      redraw:
+		_init_grid();
+		_init_window(text_win);
+		xcord = 1;
+		ycord = 1;
+		//if (params.iterate && params.long_output)
+		print_date();
+		switch (params.display) {
+		case JOBS:
+			_get_job();
+			break;
+		default:
+			_get_part();
+			break;
+		}
+
+		_print_grid();
+		box(text_win, 0, 0);
+		box(grid_win, 0, 0);
+		wrefresh(text_win);
+		wrefresh(grid_win);
+		//sleep(5);
+		if (params.iterate) {
+			for (i = 0; i < params.iterate; i++) {
+				sleep(1);
+				ch = getch();
+				switch (ch) {
+				case 'b':
+					params.display = BGLPART;
+					goto redraw;
+					break;
+				case 's':
+					params.display = SLURMPART;
+					goto redraw;
+					break;
+				case 'j':
+					params.display = JOBS;
+					goto redraw;
+					break;
+				case 'q':
+				case '\n':
+					endwin();
+					exit(0);
+					break;
+				}
+			}
+		} else
+			break;
+	}
+
+	nodelay(stdscr, FALSE);
+	getch();
 	endwin();
+
 	exit(0);
-	break;
-      }  
-    
-    GridCount=0;
-    _init_grid();
-    _init_window(text_win);
-    xcord = 1;
-    ycord = 1;
-    if ( params.iterate && (params.verbose || params.long_output ))
-      print_date();
-    
-    switch(params.Display) 
-      {
-      case JOBS:
-	_print_job( );
-	break;
-      case SLURMPART:
-	if (_query_server(&partition_msg, &node_msg) != 0)
-	  exit(1);
-	smap_list = list_create(_smap_list_delete);
-	_build_smap_data(smap_list, partition_msg, node_msg);
-	sort_smap_list(smap_list);
-	print_smap_list(smap_list);
-	break;
-      case BGLPART:
-	if (_query_server(&partition_msg, &node_msg) != 0)
-	  exit(1);
-	break;
-      }
-    
-    _print_grid();
-    box(text_win,0,0);
-    box(grid_win,0,0);
-    wrefresh(text_win);
-    wrefresh(grid_win);
-    //sleep(5);
-    if (params.iterate) {
-      if(params.Display>JOBS)
-	list_destroy(smap_list);
-      for(i=0;i<params.iterate;i++)
-	{
-	  sleep(1);
-	  ch = getch();
-	  switch(ch)
-	    {
-	    case 'q':
-	    case '\n':
-	      endwin();
-	      exit(0);
-	      break;
-	    }  
-	}
-    } else
-      break;
-    
-    
-  }
-  
-  nodelay(stdscr, FALSE);
-  getch();
-  endwin();
-    
-  exit(0);
 }
 
-/* _init_window - clear window */
-static void _init_window(WINDOW * win)
+void print_date(void)
 {
-  int x,y;
-  for(x=1;x<win->_maxx;x++)
-    for(y=1;y<ycord;y++)
-      mvwaddch(win,y,x,' ');
-  return;
-}
-/* _init_grid - set values of every grid point */
-static void _init_grid( void )
-{
-  int x,y,z;
-  for(x=0;x<X;x++)
-    for(y=0;y<Y;y++)
-      for(z=0;z<Z;z++)
-	{
-	  Axis[x][y][z].color = 7;
-	  Axis[x][y][z].letter = '.';
-	}
-  y=65;
-  z=0;
-  for(x=0;x<NumofProc;x++)
-    {      
-      FillInValue[x].letter = y;
-      z = z%7;
-      if(z==0)
-	z=1;
-      FillInValue[x].color = z;
-      z++;
-      y++;
-    }  
-  return;
+	now = time(NULL);
+	mvwprintw(text_win, ycord, xcord, "%s", ctime(&now));
+	ycord++;
 }
 
-/* _print_grid - print values of every grid point */
-static void _print_grid( void )
+void print_header_part(void)
 {
-  int x,y,z,offset=Z;
-  int xcord, ycord=2;
-  for(y=Y-1;y>=0;y--)
-    {
-      offset=Z+1;
-      for(z=0;z<Z;z++)
-	{
-	  xcord=offset;
-	  
-	  for(x=0;x<X;x++)
-	    {
-	      init_pair(Axis[x][y][z].color, Axis[x][y][z].color, COLOR_BLACK);
-	      wattron(grid_win,COLOR_PAIR(Axis[x][y][z].color));
-	      //printf("%d%d%d %c",x,y,z,Axis[x][y][z].letter);
-	      mvwprintw(grid_win,ycord,xcord,"%c",Axis[x][y][z].letter);
-	      wattroff(grid_win,COLOR_PAIR(Axis[x][y][z].color));
-	      xcord++;
-	    }
-	  ycord++;
-	  offset--;      
-	}
-      ycord++;
-    }
-  return;
+	mvwprintw(text_win, ycord, xcord, "IDENT");
+	xcord += 8;
+	mvwprintw(text_win, ycord, xcord, "PARTITION");
+	xcord += 12;
+	mvwprintw(text_win, ycord, xcord, "AVAIL");
+	xcord += 10;
+	mvwprintw(text_win, ycord, xcord, "TIMELIMIT");
+	xcord += 12;
+	mvwprintw(text_win, ycord, xcord, "NODES");
+	xcord += 8;
+	mvwprintw(text_win, ycord, xcord, "NODELIST");
+	xcord = 1;
+	ycord++;
 }
-/* get_window_width - return the size of the window STDOUT goes to */
-static int  
-_get_window_width( void )
+void print_header_job(void)
 {
-	int width = 80;
-
-#ifdef TIOCGSIZE
-	struct ttysize win;
-	if (ioctl (STDOUT_FILENO, TIOCGSIZE, &win) == 0)
-		width = win.ts_cols;
-#elif defined TIOCGWINSZ
-	struct winsize win;
-	if (ioctl (STDOUT_FILENO, TIOCGWINSZ, &win) == 0)
-		width = win.ws_col;
-#else
-	const char *s;
-	s = getenv("COLUMNS");
-	if (s)
-		width = strtol(s,NULL,10);
-#endif
-	return width;
-}
+	mvwprintw(text_win, ycord, xcord, "IDENT");
+	xcord += 8;
+	mvwprintw(text_win, ycord, xcord, "JOBID");
+	xcord += 8;
+	mvwprintw(text_win, ycord, xcord, "PARTITION");
+	xcord += 12;
+	mvwprintw(text_win, ycord, xcord, "USER");
+	xcord += 10;
+	mvwprintw(text_win, ycord, xcord, "NAME");
+	xcord += 12;
+	mvwprintw(text_win, ycord, xcord, "STATE");
+	xcord += 10;
+	mvwprintw(text_win, ycord, xcord, "TIME");
+	xcord += 12;
+	mvwprintw(text_win, ycord, xcord, "NODES");
+	xcord += 8;
+	mvwprintw(text_win, ycord, xcord, "NODELIST");
+	xcord = 1;
+	ycord++;
 
-
-/* _print_job - print the specified job's information */
-static void 
-_print_job ( void ) 
-{
-  static job_info_msg_t * old_job_ptr = NULL, * new_job_ptr;
-  int error_code;
-  uint16_t show_flags = 0;
-  
-  if (params.all_flag)
-    show_flags |= SHOW_ALL;
-  
-  if (old_job_ptr) {
-    error_code = slurm_load_jobs (old_job_ptr->last_update, 
-				  &new_job_ptr, show_flags);
-    if (error_code ==  SLURM_SUCCESS)
-      slurm_free_job_info_msg( old_job_ptr );
-    else if (slurm_get_errno () == SLURM_NO_CHANGE_IN_DATA) {
-      error_code = SLURM_SUCCESS;
-      new_job_ptr = old_job_ptr;
-    }
-  }
-  else
-    error_code = slurm_load_jobs ((time_t) NULL, &new_job_ptr,
-				  show_flags);
-  if (error_code) {
-    slurm_perror ("slurm_load_jobs error");
-    return;
-  }
-  old_job_ptr = new_job_ptr;
-  
-  if (quiet_flag == -1)
-    printf ("last_update_time=%ld\n", 
-	    (long) new_job_ptr->last_update);
-  
-  if (params.format_list == NULL)
-    parse_format_jobs(params.format);
-  print_jobs_array( new_job_ptr->job_array, new_job_ptr->record_count , 
-		    params.format_list ) ;
-  return;
 }
 
-
-/*
- * _query_server - download the current server state
- * part_pptr IN/OUT - partition information message
- * node_pptr IN/OUT - node information message 
- * RET zero or error code
- */
-static int
-_query_server(partition_info_msg_t ** part_pptr,
-	      node_info_msg_t ** node_pptr)
+static void _get_job()
 {
-  static partition_info_msg_t *old_part_ptr = NULL, *new_part_ptr;
-  static node_info_msg_t *old_node_ptr = NULL, *new_node_ptr;
-  int error_code;
-  uint16_t show_flags = 0;
-  
-  if (params.all_flag)
-    show_flags |= SHOW_ALL;
-  
-  if (old_part_ptr) {
-    error_code = slurm_load_partitions(old_part_ptr->last_update,
-				       &new_part_ptr, show_flags);
-    if (error_code == SLURM_SUCCESS)
-      slurm_free_partition_info_msg(old_part_ptr);
-    else if (slurm_get_errno() == SLURM_NO_CHANGE_IN_DATA) {
-      error_code = SLURM_SUCCESS;
-      new_part_ptr = old_part_ptr;
-    }
-  } else
-    error_code = slurm_load_partitions((time_t) NULL, &new_part_ptr,
-				       show_flags);
-  if (error_code) {
-    slurm_perror("slurm_load_part");
-    return error_code;
-  }
-  
-  old_part_ptr = new_part_ptr;
-  *part_pptr = new_part_ptr;
-  
-  if (old_node_ptr) {
-    error_code = slurm_load_node(old_node_ptr->last_update,
-				 &new_node_ptr, show_flags);
-    if (error_code == SLURM_SUCCESS)
-      slurm_free_node_info_msg(old_node_ptr);
-    else if (slurm_get_errno() == SLURM_NO_CHANGE_IN_DATA) {
-      error_code = SLURM_SUCCESS;
-      new_node_ptr = old_node_ptr;
-    }
-  } else
-    error_code = slurm_load_node((time_t) NULL, &new_node_ptr,
-				 show_flags);
-  if (error_code) {
-    slurm_perror("slurm_load_node");
-    return error_code;
-  }
-  old_node_ptr = new_node_ptr;
-  *node_pptr = new_node_ptr;
-  
-  return SLURM_SUCCESS;
-}
+	int error_code = -1, i, j, count = 0;
 
-/*
- * _build_smap_data - make a smap_data entry for each unique node 
- *	configuration and add it to the smap_list for later printing.
- * smap_list IN/OUT - list of unique smap_dataa records to report
- * partition_msg IN - partition info message
- * node_msg IN - node info message
- * RET zero or error code 
- */
-static int _build_smap_data(List smap_list, 
-		partition_info_msg_t *partition_msg, node_info_msg_t *node_msg)
-{
-	node_info_t *node_ptr;
-	partition_info_t* part_ptr;
-	ListIterator i;
-	int j;
-	uint16_t part_inx;
-
-	/* by default every partition is shown, even if no nodes */
-	if ((!params.node_flag) && params.match_flags.partition_flag) {
-	  part_ptr = partition_msg->partition_array;
-	  for (j=0; j<partition_msg->record_count; j++, part_ptr++) {
-	    if ((!params.partition) || 
-		(_strcmp(params.partition, part_ptr->name) == 0))
-	      _create_smap(smap_list, part_ptr, 
-			     (uint16_t) j, NULL);
-	  }
-	}
+	job_info_msg_t *job_info_ptr = NULL;
+	job_info_t job;
 
-	/* make smap_list entries for each node */
-	for (j=0; j<node_msg->record_count; j++) {
-		smap_data_t *smap_ptr;
-		node_ptr = &(node_msg->node_array[j]);
-
-		if (params.filtering && _filter_out(node_ptr))
-			continue;
-
-		part_ptr = _find_part(node_ptr->partition, partition_msg, 
-				&part_inx);
-		if ( ! part_ptr )
-			continue;
-		i = list_iterator_create(smap_list);
-		/* test if node can be added to existing smap_data entry */
-		while ((smap_ptr = list_next(i))) {
-			if (!_match_part_data(smap_ptr, part_ptr))
-				continue;
-			if (smap_ptr->nodes_tot &&
-			    (!_match_node_data(smap_ptr, node_ptr)))
-				continue;
-
-			/* This node has the same configuration as this 
-			 * smap_data, just add to this record */
-			_update_smap(smap_ptr, part_ptr, node_ptr);
-			break;
+	error_code = slurm_load_jobs((time_t) NULL, &job_info_ptr, 0);
+	if (error_code) {
+		if (quiet_flag != 1)
+			slurm_perror("slurm_load_jobs error");
+		return;
+	}
+	if (job_info_ptr->record_count && !params.no_header)
+		print_header_job();
+	for (i = 0; i < job_info_ptr->record_count; i++) {
+		job = job_info_ptr->job_array[i];
+		if (job.node_inx[0] != -1) {
+			job.num_nodes = 0;
+			j = 0;
+			while (job.node_inx[j] >= 0) {
+				job.num_nodes +=
+				    (job.node_inx[j + 1] + 1) -
+				    job.node_inx[j];
+				set_grid(job.node_inx[j],
+					 job.node_inx[j + 1], count);
+				j += 2;
+			}
+			job.num_procs = (int) fill_in_value[count].letter;
+			wattron(text_win,
+				COLOR_PAIR(fill_in_value[count].color));
+			_print_job(&job);
+			wattroff(text_win,
+				 COLOR_PAIR(fill_in_value[count].color));
+			count++;
 		}
-	
-		/* no match, create new smap_data entry */
-		if (smap_ptr == NULL)
-			_create_smap(smap_list, part_ptr, part_inx, node_ptr);
-		list_iterator_destroy(i);
 	}
-
-	_sort_hostlist(smap_list);
-	return SLURM_SUCCESS;
+	return;
 }
 
-/*
- * _filter_out - Determine if the specified node should be filtered out or 
- *	reported.
- * node_ptr IN - node to consider filtering out
- * RET - true if node should not be reported, false otherwise
- */
-static bool _filter_out(node_info_t *node_ptr)
+static void _get_part(void)
 {
-	static hostlist_t host_list = NULL;
-
-	if (params.partition && 
-	    _strcmp(node_ptr->partition, params.partition))
-		return true;
-
-	if (params.nodes) {
-		if (host_list == NULL)
-			host_list = hostlist_create(params.nodes);
-		if (hostlist_find (host_list, node_ptr->name) == -1)
-			return true;
+	int error_code, i, j, count = 0;
+	partition_info_msg_t *part_info_ptr;
+	partition_info_t part;
+	char node_entry[13];
+	int start, startx, starty, startz, endx, endy, endz;
+	error_code =
+	    slurm_load_partitions((time_t) NULL, &part_info_ptr, 0);
+	if (error_code) {
+		if (quiet_flag != 1)
+			slurm_perror("slurm_load_partitions error");
+		return;
 	}
 
-	if ( (params.dead_nodes) &&
-	     (!(node_ptr->node_state & NODE_STATE_NO_RESPOND)) )
-		return true;
-
-	if ( (params.responding_nodes) &&
-	     (node_ptr->node_state & NODE_STATE_NO_RESPOND) )
-		return true;
-
-	if (params.state_list) {
-		int *node_state;
-		bool match = false;
-		ListIterator iterator;
-		iterator = list_iterator_create(params.state_list);
-		while ((node_state = list_next(iterator))) {
-			if ( (node_ptr->node_state == *node_state) || 
-					((node_ptr->node_state & 
-					 (~NODE_STATE_NO_RESPOND)) == 
-					 *node_state) ) {
-				match = true;
-				break;
+	if (part_info_ptr->record_count && !params.no_header)
+		print_header_part();
+	for (i = 0; i < part_info_ptr->record_count; i++) {
+		j = 0;
+		part = part_info_ptr->partition_array[i];
+
+		if (params.display == BGLPART) {
+			memset(node_entry, 0, 13);
+			memcpy(node_entry, part.nodes, 12);
+			part.allow_groups = node_entry;
+			while (part.nodes[j] != '\0') {
+				if (part.nodes[j] == '[') {
+					j++;
+					start = atoi(part.nodes + j);
+					startx = start / 100;
+					starty = (start % 100) / 10;
+					startz = (start % 10);
+					j += 4;
+					start = atoi(part.nodes + j);
+					endx = start / 100;
+					endy = (start % 100) / 10;
+					endz = (start % 10);
+					j += 5;
+
+					part.total_nodes =
+					    set_grid_bgl(startx, starty,
+							 startz, endx,
+							 endy, endz,
+							 count);
+					part.root_only =
+					    (int) fill_in_value[count].
+					    letter;
+					wattron(text_win,
+						COLOR_PAIR(fill_in_value
+							   [count].color));
+					_print_part(&part);
+					wattroff(text_win,
+						 COLOR_PAIR(fill_in_value
+							    [count].
+							    color));
+					count++;
+					memset(node_entry, 0, 13);
+					memcpy(node_entry, part.nodes + j,
+					       12);
+					part.allow_groups = node_entry;
+
+				}
+				j++;
+			}
+		} else {
+			while (part.node_inx[j] >= 0) {
+
+				set_grid(part.node_inx[j],
+					 part.node_inx[j + 1], count);
+				j += 2;
+
+				part.root_only =
+				    (int) fill_in_value[count].letter;
+				wattron(text_win,
+					COLOR_PAIR(fill_in_value[count].
+						   color));
+				_print_part(&part);
+				wattroff(text_win,
+					 COLOR_PAIR(fill_in_value[count].
+						    color));
+				count++;
 			}
 		}
-		list_iterator_destroy(iterator);
-		if (!match)
-			return true;
 	}
 
-	return false;
-}
-
-static void _sort_hostlist(List smap_list)
-{
-	ListIterator i;
-	smap_data_t *smap_ptr;
-
-	i = list_iterator_create(smap_list);
-	while ((smap_ptr = list_next(i)))
-		hostlist_sort(smap_ptr->nodes);
-	list_iterator_destroy(i);
+	return;
 }
 
-static bool _match_node_data(smap_data_t *smap_ptr, 
-                             node_info_t *node_ptr)
+static int _print_job(job_info_t * job_ptr)
 {
-	if (smap_ptr->nodes &&
-	    params.match_flags.features_flag &&
-	    (_strcmp(node_ptr->features, smap_ptr->features)))
-		return false;
-
-	if (smap_ptr->nodes &&
-	    params.match_flags.reason_flag &&
-	    (_strcmp(node_ptr->reason, smap_ptr->reason)))
-		return false;
-
-	if (params.match_flags.state_flag &&
-	    (node_ptr->node_state != smap_ptr->node_state))
-		return false;
-
-	/* If no need to exactly match sizes, just return here 
-	 * otherwise check cpus, disk, memory and weigth individually */
-	if (!params.exact_match)
-		return true;
-	if (params.match_flags.cpus_flag &&
-	    (node_ptr->cpus        != smap_ptr->min_cpus))
-		return false;
-	if (params.match_flags.disk_flag &&
-	    (node_ptr->tmp_disk    != smap_ptr->min_disk))
-		return false;
-	if (params.match_flags.memory_flag &&
-	    (node_ptr->real_memory != smap_ptr->min_mem))
-		return false;
-	if (params.match_flags.weight_flag &&
-	    (node_ptr->weight      != smap_ptr->min_weight))
-		return false;
-
-	return true;
-}
+	time_t time;
+	int printed = 0;
+	int tempxcord;
+	int prefixlen;
+	int i = 0;
+	int width = 0;
+	struct passwd *user = NULL;
+	long days, hours, minutes, seconds;
+
+	mvwprintw(text_win, ycord, xcord, "%c", job_ptr->num_procs);
+	xcord += 8;
+	mvwprintw(text_win, ycord, xcord, "%d", job_ptr->job_id);
+	xcord += 8;
+	mvwprintw(text_win, ycord, xcord, "%s", job_ptr->partition);
+	xcord += 12;
+	user = getpwuid((uid_t) job_ptr->user_id);
+	mvwprintw(text_win, ycord, xcord, "%s", user->pw_name);
+	xcord += 10;
+	mvwprintw(text_win, ycord, xcord, "%s", job_ptr->name);
+	xcord += 12;
+	mvwprintw(text_win, ycord, xcord, "%s",
+		  job_state_string(job_ptr->job_state));
+	xcord += 10;
+	time = now - job_ptr->start_time;
+
+	seconds = time % 60;
+	minutes = (time / 60) % 60;
+	hours = (time / 3600) % 24;
+	days = time / 86400;
+
+	if (days)
+		mvwprintw(text_win, ycord, xcord,
+			  "%ld:%2.2ld:%2.2ld:%2.2ld", days, hours, minutes,
+			  seconds);
+	else if (hours)
+		mvwprintw(text_win, ycord, xcord, "%ld:%2.2ld:%2.2ld",
+			  hours, minutes, seconds);
+	else
+		mvwprintw(text_win, ycord, xcord, "%ld:%2.2ld", minutes,
+			  seconds);
+
+	xcord += 12;
+	mvwprintw(text_win, ycord, xcord, "%d", job_ptr->num_nodes);
+	xcord += 8;
+	tempxcord = xcord;
+	width = text_win->_maxx - xcord;
+	while (job_ptr->nodes[i] != '\0') {
+		if ((printed =
+		     mvwaddch(text_win, ycord, xcord,
+			      job_ptr->nodes[i])) < 0)
+			return printed;
+		xcord++;
+		width = text_win->_maxx - xcord;
+		if (job_ptr->nodes[i] == '[')
+			prefixlen = i + 1;
+		else if (job_ptr->nodes[i] == ',' && (width - 9) <= 0) {
+			ycord++;
+			xcord = tempxcord + prefixlen;
+		}
+		i++;
+	}
 
-static bool _match_part_data(smap_data_t *smap_ptr, 
-                             partition_info_t* part_ptr)
-{
-	if (part_ptr == smap_ptr->part_info) /* identical partition */
-		return true;
-	if ((part_ptr == NULL) || (smap_ptr->part_info == NULL))
-		return false;
-
-	if (params.match_flags.avail_flag &&
-	    (part_ptr->state_up != smap_ptr->part_info->state_up))
-		return false;
-			
-	if (params.match_flags.groups_flag &&
-	    (_strcmp(part_ptr->allow_groups, 
-	             smap_ptr->part_info->allow_groups)))
-		return false;
-
-	if (params.match_flags.job_size_flag &&
-	    (part_ptr->min_nodes != smap_ptr->part_info->min_nodes))
-		return false;
-
-	if (params.match_flags.job_size_flag &&
-	    (part_ptr->max_nodes != smap_ptr->part_info->max_nodes))
-		return false;
-
-	if (params.match_flags.max_time_flag &&
-	    (part_ptr->max_time != smap_ptr->part_info->max_time))
-		return false;
-
-	if (params.match_flags.partition_flag &&
-	    (_strcmp(part_ptr->name, smap_ptr->part_info->name)))
-		return false;
-
-	if (params.match_flags.root_flag &&
-	    (part_ptr->root_only != smap_ptr->part_info->root_only))
-		return false;
-
-	if (params.match_flags.share_flag &&
-	    (part_ptr->shared != smap_ptr->part_info->shared))
-		return false;
-
-	return true;
+	xcord = 1;
+	ycord++;
+	return printed;
 }
 
-static void _update_smap(smap_data_t *smap_ptr, partition_info_t* part_ptr, 
-		node_info_t *node_ptr)
+static int _print_part(partition_info_t * part_ptr)
 {
-	if (smap_ptr->nodes_tot == 0) {	/* first node added */
-		smap_ptr->node_state = node_ptr->node_state;
-		smap_ptr->features   = node_ptr->features;
-		smap_ptr->reason     = node_ptr->reason;
-		smap_ptr->min_cpus   = node_ptr->cpus;
-		smap_ptr->max_cpus   = node_ptr->cpus;
-		smap_ptr->min_disk   = node_ptr->tmp_disk;
-		smap_ptr->max_disk   = node_ptr->tmp_disk;
-		smap_ptr->min_mem    = node_ptr->real_memory;
-		smap_ptr->max_mem    = node_ptr->real_memory;
-		smap_ptr->min_weight = node_ptr->weight;
-		smap_ptr->max_weight = node_ptr->weight;
-	} else {
-		if (smap_ptr->min_cpus > node_ptr->cpus)
-			smap_ptr->min_cpus = node_ptr->cpus;
-		if (smap_ptr->max_cpus < node_ptr->cpus)
-			smap_ptr->max_cpus = node_ptr->cpus;
-
-		if (smap_ptr->min_disk > node_ptr->tmp_disk)
-			smap_ptr->min_disk = node_ptr->tmp_disk;
-		if (smap_ptr->max_disk < node_ptr->tmp_disk)
-			smap_ptr->max_disk = node_ptr->tmp_disk;
-
-		if (smap_ptr->min_mem > node_ptr->real_memory)
-			smap_ptr->min_mem = node_ptr->real_memory;
-		if (smap_ptr->max_mem < node_ptr->real_memory)
-			smap_ptr->max_mem = node_ptr->real_memory;
-
-		if (smap_ptr->min_weight> node_ptr->weight)
-			smap_ptr->min_weight = node_ptr->weight;
-		if (smap_ptr->max_weight < node_ptr->weight)
-			smap_ptr->max_weight = node_ptr->weight;
+	int printed = 0;
+	int tempxcord;
+	int prefixlen;
+	int i = 0;
+	int width = 0;
+	char *nodes;
+
+	mvwprintw(text_win, ycord, xcord, "%c", part_ptr->root_only);
+	xcord += 8;
+	mvwprintw(text_win, ycord, xcord, "%s", part_ptr->name);
+	xcord += 12;
+	if (part_ptr->state_up)
+		mvwprintw(text_win, ycord, xcord, "UP");
+	else
+		mvwprintw(text_win, ycord, xcord, "DOWN");
+	xcord += 10;
+	if (part_ptr->max_time == INFINITE)
+		mvwprintw(text_win, ycord, xcord, "UNLIMITED");
+	else
+		mvwprintw(text_win, ycord, xcord, "%u",
+			  part_ptr->max_time);
+
+	xcord += 12;
+	mvwprintw(text_win, ycord, xcord, "%d", part_ptr->total_nodes);
+	xcord += 8;
+
+	tempxcord = xcord;
+	width = text_win->_maxx - xcord;
+	if (params.display == BGLPART)
+		nodes = part_ptr->allow_groups;
+	else
+		nodes = part_ptr->nodes;
+	while (nodes[i] != '\0') {
+		if ((printed =
+		     mvwaddch(text_win, ycord, xcord, nodes[i])) < 0)
+			return printed;
+		xcord++;
+		width = text_win->_maxx - xcord;
+		if (nodes[i] == '[')
+			prefixlen = i + 1;
+		else if (nodes[i] == ',' && (width - 9) <= 0) {
+			ycord++;
+			xcord = tempxcord + prefixlen;
+		}
+		i++;
 	}
 
-	if ((node_ptr->node_state == NODE_STATE_ALLOCATED) ||
-	    (node_ptr->node_state == NODE_STATE_COMPLETING))
-		smap_ptr->nodes_alloc++;
-	else if (node_ptr->node_state == NODE_STATE_IDLE)
-		smap_ptr->nodes_idle++;
-	else 
-		smap_ptr->nodes_other++;
-	smap_ptr->nodes_tot++;
+	xcord = 1;
+	ycord++;
 
-	hostlist_push(smap_ptr->nodes, node_ptr->name);
+	return printed;
 }
 
-/* 
- * _create_smap - create an smap record for the given node and partition
- * smap_list IN/OUT - table of accumulated smap records
- * part_ptr IN       - pointer to partition record to add
- * part_inx IN       - index of partition record (0-origin)
- * node_ptr IN       - pointer to node record to add
- */
-static void _create_smap(List smap_list, partition_info_t* part_ptr, 
-		uint16_t part_inx, node_info_t *node_ptr)
+int set_grid_bgl(int startx, int starty, int startz, int endx, int endy,
+		 int endz, int count)
 {
-	smap_data_t *smap_ptr;
-
-	/* create an entry */
-	smap_ptr = xmalloc(sizeof(smap_data_t));
-
-	smap_ptr->part_info = part_ptr;
-
-	if (node_ptr) {
-		smap_ptr->node_state = node_ptr->node_state;
-		if ((node_ptr->node_state == NODE_STATE_ALLOCATED) ||
-		    (node_ptr->node_state == NODE_STATE_COMPLETING))
-			smap_ptr->nodes_alloc++;
-		else if (node_ptr->node_state == NODE_STATE_IDLE)
-			smap_ptr->nodes_idle++;
-		else 
-			smap_ptr->nodes_other++;
-		smap_ptr->nodes_tot++;
-
-		smap_ptr->min_cpus = node_ptr->cpus;
-		smap_ptr->max_cpus = node_ptr->cpus;
-
-		smap_ptr->min_disk = node_ptr->tmp_disk;
-		smap_ptr->max_disk = node_ptr->tmp_disk;
-
-		smap_ptr->min_mem = node_ptr->real_memory;
-		smap_ptr->max_mem = node_ptr->real_memory;
-
-		smap_ptr->min_weight = node_ptr->weight;
-		smap_ptr->max_weight = node_ptr->weight;
-
-		smap_ptr->features = node_ptr->features;
-		smap_ptr->reason   = node_ptr->reason;
-
-		smap_ptr->nodes = hostlist_create(node_ptr->name);
-
-		smap_ptr->part_inx = part_inx;
-	} else {
-		smap_ptr->nodes = hostlist_create("");
-	}
+	int x, y, z;
+	int i = 0;
+	for (x = startx; x <= endx; x++)
+		for (y = starty; y <= endy; y++)
+			for (z = startz; z <= endz; z++) {
+				grid[x][y][z].letter =
+				    fill_in_value[count].letter;
+				grid[x][y][z].color =
+				    fill_in_value[count].color;
+				i++;
+			}
 
-	list_append(smap_list, smap_ptr);
+	return i;
 }
 
-/* 
- * _find_part - find a partition by name
- * part_name IN     - name of partition to locate
- * partition_msg IN - partition information message from API
- * part_inx OUT     - index of the partition within the table (0-origin)
- */
-static partition_info_t *_find_part(char *part_name, 
-			partition_info_msg_t *partition_msg, 
-			uint16_t *part_inx) 
+int set_grid(int start, int end, int count)
 {
-	int i;
-	for (i=0; i<partition_msg->record_count; i++) {
-		if (_strcmp(part_name, 
-		            partition_msg->partition_array[i].name))
-			continue;
-		*part_inx = i;
-		return &(partition_msg->partition_array[i]);
-	}
+	int x, y, z;
+	for (y = Y - 1; y >= 0; y--)
+		for (z = 0; z < Z; z++)
+			for (x = 0; x < X; x++) {
+				if (grid[x][y][z].indecies >= start
+				    && grid[x][y][z].indecies <= end) {
+					grid[x][y][z].letter =
+					    fill_in_value[count].letter;
+					grid[x][y][z].color =
+					    fill_in_value[count].color;
+				}
+			}
 
-	*part_inx = 0;	/* not correct, but better than random data */
-	return NULL;
+	return 1;
 }
 
-static void _smap_list_delete(void *data)
+/* _init_window - clear window */
+static void _init_window(WINDOW * win)
 {
-	smap_data_t *smap_ptr = data;
-
-	xfree(smap_ptr->features);
-	hostlist_destroy(smap_ptr->nodes);
-	xfree(smap_ptr);
+	int x, y;
+	for (x = 1; x < win->_maxx; x++)
+		for (y = 1; y < ycord; y++)
+			mvwaddch(win, y, x, ' ');
+	return;
 }
 
-/* like strcmp, but works with NULL pointers */
-static int _strcmp(char *data1, char *data2) 
+/* _init_grid - set values of every grid point */
+static void _init_grid(void)
 {
-	static char null_str[] = "(null)";
-
-	if (data1 == NULL)
-		data1 = null_str;
-	if (data2 == NULL)
-		data2 = null_str;
-	return strcmp(data1, data2);
+	int x, y, z, i = 0;
+	for (x = 0; x < X; x++)
+		for (y = 0; y < Y; y++)
+			for (z = 0; z < Z; z++) {
+				grid[x][y][z].color = 7;
+				grid[x][y][z].letter = '.';
+				grid[x][y][z].indecies = i++;
+			}
+	y = 65;
+	z = 0;
+	for (x = 0; x < num_of_proc; x++) {
+		fill_in_value[x].letter = y;
+		z = z % 7;
+		if (z == 0)
+			z = 1;
+		fill_in_value[x].color = z;
+		z++;
+		y++;
+	}
+	return;
 }
 
+/* _print_grid - print values of every grid point */
+static void _print_grid(void)
+{
+	int x, y, z, i = 0, offset = Z;
+	int grid_xcord, grid_ycord = 2;
+	for (y = Y - 1; y >= 0; y--) {
+		offset = Z + 1;
+		for (z = 0; z < Z; z++) {
+			grid_xcord = offset;
+
+			for (x = 0; x < X; x++) {
+				init_pair(grid[x][y][z].color,
+					  grid[x][y][z].color,
+					  COLOR_BLACK);
+				wattron(grid_win,
+					COLOR_PAIR(grid[x][y][z].color));
+				//printf("%d%d%d %c",x,y,z,grid[x][y][z].letter);
+				mvwprintw(grid_win, grid_ycord, grid_xcord,
+					  "%c", grid[x][y][z].letter);
+				wattroff(grid_win,
+					 COLOR_PAIR(grid[x][y][z].color));
+				grid_xcord++;
+				i++;
+			}
+			grid_ycord++;
+			offset--;
+		}
+		grid_ycord++;
+	}
+	return;
+}
diff --git a/src/smap/smap.h b/src/smap/smap.h
index 99ace5e5ed6ebbf4f51040a19a30f0b83ff47d42..0386617959e169dbfecfbf7d2adcdd4d8eafcac9 100644
--- a/src/smap/smap.h
+++ b/src/smap/smap.h
@@ -31,6 +31,7 @@
 #  include "config.h"
 #endif
 
+#include <pwd.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -41,142 +42,54 @@
 
 #if HAVE_INTTYPES_H
 #  include <inttypes.h>
-#else  /* !HAVE_INTTYPES_H */
+#else				/* !HAVE_INTTYPES_H */
 #  if HAVE_STDINT_H
 #    include <stdint.h>
 #  endif
-#endif  /* HAVE_INTTYPES_H */
+#endif				/* HAVE_INTTYPES_H */
 
 #include <slurm/slurm.h>
 
-#include "src/common/hostlist.h"
-#include "src/common/list.h"
-#include "src/common/log.h"
-#include "src/common/macros.h"
 #include "src/common/slurm_protocol_api.h"
 #include "src/common/xmalloc.h"
 
-enum {JOBS, SLURMPART, BGLPART }; 
-
-typedef struct job_step {
-  uint32_t job_id;
-  uint32_t step_id;
-}squeue_job_step_t;
-
-/* Collection of data for printing reports. Like data is combined here */
-typedef struct {
-  uint16_t node_state;
-  
-  uint32_t nodes_alloc;
-  uint32_t nodes_idle;
-  uint32_t nodes_other;
-  uint32_t nodes_tot;
-  uint32_t min_cpus;
-  uint32_t max_cpus;
-  uint32_t min_disk;
-  uint32_t max_disk;
-  uint32_t min_mem;
-  uint32_t max_mem;
-  uint32_t min_weight;
-  uint32_t max_weight;
-  
-  char *features;
-  char *reason;
-  
-  hostlist_t nodes;
-  
-  /* part_info contains partition, avail, max_time, job_size, 
-   * root, share, groups */
-  partition_info_t* part_info;
-  uint16_t part_inx;
-} smap_data_t;
-
-/* Identify what fields must match for a node's information to be 
- * combined into a single smap_data entry based upon output format */
-struct smap_match_flags {
-  bool avail_flag;
-  bool cpus_flag;
-  bool disk_flag;
-  bool features_flag;
-  bool groups_flag;
-  bool job_size_flag;
-  bool max_time_flag;
-  bool memory_flag;
-  bool partition_flag;
-  bool reason_flag;
-  bool root_flag;
-  bool share_flag;
-  bool state_flag;
-  bool weight_flag;
-};
+enum { JOBS, SLURMPART, BGLPART };
 
 /* Input parameters */
 struct smap_parameters {
-  // job parts
-  bool job_flag;
-  bool step_flag;
-  bool long_list;
-  
-  int  max_procs;
-  
-  char* jobs;
-  char* partitions;
-  char* steps;
-  char* users;
-  
-  List  job_list;
-  List  part_list;
-  List  step_list;
-  List  user_list;
-
-  //Both
-  bool all_flag;
-  bool no_header;
-  
-  char* format;
-  char* sort;
-  char* states;
-
-  int  iterate;
-  int  verbose;
-  int  Display;
-
-  List  format_list;
-  List  state_list;
-
-  // partition parts
-  bool dead_nodes;
-  bool exact_match;
-  bool filtering;
-  bool long_output;
-  bool node_field_flag;
-  bool node_flag;
-  bool responding_nodes;
-  bool list_reasons;
-  bool summarize;
-  
-  struct smap_match_flags match_flags;
-  
-  char* nodes;
-  char* partition;
-  
-  int node_field_size;
+	//Both
+	bool all_flag;
+	bool no_header;
+
+	char *format;
+	char *sort;
+	char *states;
+
+	int iterate;
+	int verbose;
+	int display;
+
+	bool long_output;
+
+	char *nodes;
+	char *partition;
+
+	int node_field_size;
 
 };
 
 extern struct smap_parameters params;
-extern int xcord;
-extern int ycord;
-extern WINDOW *grid_win;
-extern WINDOW *text_win;
-
-extern void parse_command_line( int argc, char* argv[] );
-extern int  parse_format( char* format );
-extern int  parse_format_jobs( char* format );
-extern void sort_job_list( List job_list );
-extern void sort_jobs_by_start_time( List job_list );
-extern void sort_step_list( List step_list );
-extern int  parse_state( char* str, uint16_t* states );
-extern void sort_smap_list( List smap_list );
+
+extern void parse_command_line(int argc, char *argv[]);
+
+#define X 8
+#define Y 4
+#define Z 4
+#define num_of_proc 128
+typedef struct {
+	char letter;
+	int color;
+	int indecies;
+} axis;
 
 #endif