Index: client/bin/gbq
===================================================================
--- client/bin/gbq	(revision 9dee329f37d11fefa55a14b6d822242678a15d8e)
+++ client/bin/gbq	(revision 6b7441a3be5b35c91c1927ddb67153ab6063729d)
@@ -1,5 +1,6 @@
 #!/usr/bin/perl
 
-# Written by Jessica Hamrick (C) 2010
+# This script was largely written by Jessica Hamrick (jhamrick), with
+# help from Kyle Brogle (broglek)
 
 use strict;
@@ -15,8 +16,11 @@
 GetOptions ('q|queue=s' => \$q);
 
+# if the -q option is not specified, then assume we're using the
+# default queue
 if (!$q) {
     $q = "DEFAULT";
 }
 
+# set configuration path, and complain if it doesn't exist
 my $configpath = "$ENV{'HOME'}/.gutenbach/$q";
 if (! -e $configpath) {
@@ -25,6 +29,10 @@
 }
 
+# initialize the host and queue variables: host holds the address for
+# the machine on which the remote queue runs, and queue holds the name
+# of the printer
 my ($host, $queue);
 
+# load the configuration file (this will set $host and $queue)
 if (-r $configpath) {
     local $/;
@@ -34,25 +42,43 @@
 }
 
+# initialize a new CUPS session
 my $cups = Net::CUPS->new();
+# set the server to the one specified in the config file
 $cups->setServer("$host");
+# set the printer name to the one specified in the config file
 my $printer = $cups->getDestination("$queue");
 
+# if $printer is not defined, then throw an error
 unless( $printer){
     print "Cannot access queue $q...do you have network connectivity and permission to view the queue?\n";
     exit 1;
 }
+
+# print pretty headings and stuff
 print "Queue listing for queue '$queue' on '$host'\n\n";
 printf ("%-8s%-15s%s\n","Job","Owner","Title");
 print "-"x70 . "\n";
+
+# get the list of jobs from the printer
 my @jobs = $printer->getJobs(0, 0);
+
+# initialize the job reference and job id variables
 my ($job_ref, $jobid);
 
+# for each job in the list of jobs:
 foreach $jobid(@jobs) 
 {       
-	$job_ref = $printer->getJob($jobid);
-	my $id = $job_ref->{'id'};
-	my $user = $job_ref->{'user'};
-	my $title = $job_ref->{'title'};
+    # get the reference to the job (so we can get various related
+    # variables)
+    $job_ref = $printer->getJob($jobid);
 
-	printf ("%-8s%-15s%s\n","$id",substr("$user",0,15),substr("$title",0,47));
+    # get the id of the job
+    my $id = $job_ref->{'id'};
+    # get the user who printed the job
+    my $user = $job_ref->{'user'};
+    # get the title of the job
+    my $title = $job_ref->{'title'};
+    
+    # print the job information to the screen
+    printf ("%-8s%-15s%s\n","$id",substr("$user",0,15),substr("$title",0,47));
 }
Index: client/bin/gbr
===================================================================
--- client/bin/gbr	(revision 600e7130ecdae89be4f21ac6ccd5cdd2580265e5)
+++ client/bin/gbr	(revision 6b7441a3be5b35c91c1927ddb67153ab6063729d)
@@ -1,5 +1,6 @@
 #!/usr/bin/perl
 
-# Written by Jessica Hamrick (C) 2010
+# This script was largely written by Jessica Hamrick (jhamrick), with
+# help from Kyle Brogle (broglek)
 
 use strict;
@@ -18,7 +19,12 @@
 my @files = @ARGV[0 .. $#ARGV];
 
+# if the -q option is not specified, then assume we're using the
+# default queue
 if (!$q){
     $q = "DEFAULT";
 }
+
+# if there are no files specified to print, then show the usage,
+# because the user is Doing It Wrong
 if (!@files) {
     print $usage;
@@ -26,4 +32,5 @@
 }
 
+# set configuration path, and complain if it doesn't exist
 my $configpath = "$ENV{'HOME'}/.gutenbach/$q";
 if (! -e $configpath) {
@@ -32,6 +39,10 @@
 }
 
+# initialize the host and queue variables: host holds the address for
+# the machine on which the remote queue runs, and queue holds the name
+# of the printer
 my ($host, $queue);
 
+# load the configuration file (this will set $host and $queue)
 if (-r $configpath) {
     local $/;
@@ -41,14 +52,28 @@
 }
 
+# initialize a new CUPS session
 my $cups = Net::CUPS->new();
+# set the server to the one specified in the config file
 $cups->setServer("$host");
+# set the printer name to the one specified in the config file
 my $printer = $cups->getDestination("$queue");
+
+# if $printer is not defined, then throw an error
 unless( $printer){
     print "Cannot access queue $q...do you have network connectivity and permission to view the queue?\n";
     exit 1;
 }
+
+# initialize the job id and title variables for use below
 my ($jobid, $title);
 
+# for each file that the user wants to print
 foreach my $file(@files) {
+
+    # check to see if the file is a youtube video.  If it is, then
+    # write the URL to a temporary file, and set the number of copies
+    # on the print job to 42 (this is the dirty hack we have in place
+    # to indicate that the job is a youtube file instead of a normal
+    # file)
     if ($file =~ m|http://www\.youtube\.com/watch\?v=|) {
 	open FILE, ">", "/tmp/gutenbach-youtube" or die "Couldn't create temporary file";
@@ -58,4 +83,9 @@
 	$printer->addOption("copies", 42);
     }
+
+    # otherwise, we assume it's a normal file.  Try to use exiftool's
+    # ImageInfo to find out the tag information about the file (i.e.,
+    # title, artist, and album).  If you can, then rename the job to
+    # reflect those tags.  Otherwise, keep the normal title.
     else {
 	my $fileinfo = ImageInfo($file);
@@ -70,9 +100,14 @@
     }
 
+    # send the print job, given the file and the job title
     $jobid = $printer->printFile($file, $title);
     
+    # if the printFile command returned a job id, then print that out
+    # for the user to see
     if ($jobid) {
 	print "Sent job '$title' (id $jobid)\n";
     }
+
+    # otherwise, let them know that an error occurred
     else {
 	print "Error sending job '$title'\n";
Index: client/bin/gbrm
===================================================================
--- client/bin/gbrm	(revision 7cdd65d046c9006576119fc80e12f3d5a5a37478)
+++ client/bin/gbrm	(revision 6b7441a3be5b35c91c1927ddb67153ab6063729d)
@@ -1,5 +1,6 @@
 #!/usr/bin/perl
 
-# Written by Jessica Hamrick (C) 2010
+# This script was largely written by Jessica Hamrick (jhamrick), with
+# help from Kyle Brogle (broglek)
 
 use strict;
@@ -16,7 +17,11 @@
 my @ids = @ARGV[0 .. $#ARGV];
 
+# if the -q option is not specified, then assume we're using the
+# default queue
 if (!$q){
     $q = "DEFAULT";
 }
+
+# if there are no ids specified to remove, then print the usage
 if (!@ids) {
     print $usage;
@@ -24,5 +29,5 @@
 }
 
-
+# set configuration path, and complain if it doesn't exist
 my $configpath = "$ENV{'HOME'}/.gutenbach/$q";
 if (! -e $configpath) {
@@ -31,6 +36,10 @@
 }
 
+# initialize the host and queue variables: host holds the address for
+# the machine on which the remote queue runs, and queue holds the name
+# of the printer
 my ($host, $queue);
 
+# load the configuration file (this will set $host and $queue)
 if (-r $configpath) {
     local $/;
@@ -40,42 +49,65 @@
 }
 
+# initialize a new CUPS session
 my $cups = Net::CUPS->new();
+# set the server to the one specified in the config file
 $cups->setServer("$host");
+# set the printer name to the one specified in the config file
 my $printer = $cups->getDestination("$queue");
+
+# if $printer is not defined, then throw an error
 unless( $printer){
     print "Cannot access queue $q...do you have network connectivity and permission to view the queue?\n";
     exit 1;
 }
+
+# get the list of jobs from the printer
 my @jobs = $printer->getJobs(0, 0);
+
+# for each id that we want to remove
 foreach my $id(@ids){
-if ($id eq "all") {
-    foreach $id(@jobs) {
+
+    # if the id is 'all', then we remove all jobs
+    if ($id eq "all") {
+	foreach $id(@jobs) {
+	    cancel_job($id, $printer);
+	}
+    }
+
+    # if the id is 'current', then we remove just the currently
+    # playing job
+    elsif ($id eq "current") {
+	$id = $jobs[0];
 	cancel_job($id, $printer);
     }
-}
-elsif ($id eq "current") {
-    $id = $jobs[0];
-    cancel_job($id, $printer);
-}
-elsif ($id eq "last") {
-    $id = $jobs[-1];
-    cancel_job($id, $printer);
-}
-else {
-    foreach my $item(@jobs) {
-	if($item =~ /$id/){
-	    cancel_job($item, $printer);
+
+    # if the id is 'last', then we remove just the last job
+    elsif ($id eq "last") {
+	$id = $jobs[-1];
+	cancel_job($id, $printer);
+    }
+
+    # otherwise, remove the job based on its actual (numeric) id
+    else {
+	foreach my $item(@jobs) {
+	    if($item =~ /$id/){
+		cancel_job($item, $printer);
+	    }
 	}
     }
 }
-}
 
+# helper function to remove a job
 sub cancel_job {
+    # get the id and printer from the arguments
     my ($id, $printer) = @_;
+    # get the reference to the job
     my $job_ref = $printer->getJob($id);
+    # find the job title (so we can print it out for the user)
     my $title = $job_ref->{'title'};
+    # cancel the job
     $printer->cancelJob($id);
 
+    # print out that we canceled the job
     print "Canceled job '$title' (id $id)\n";
- 
 }
Index: client/bin/gutenbach-client-config
===================================================================
--- client/bin/gutenbach-client-config	(revision 814d4f8b09c2d12361d1b2d338e1da83c866724b)
+++ client/bin/gutenbach-client-config	(revision 6b7441a3be5b35c91c1927ddb67153ab6063729d)
@@ -1,5 +1,6 @@
 #!/usr/bin/perl
 
-# Written by Jessica Hamrick, (C) 2010
+# This script was largely written by Jessica Hamrick (jhamrick), with
+# help from Kyle Brogle (broglek)
 
 use strict;
@@ -7,4 +8,5 @@
 use Getopt::Long;
 
+# the usage for the program
 my $usage = <<USAGE;
 Usage: gutenbach-client-config [-l|--list|-a|--add|-d|--delete] [QUEUE] [--host=HOST]
@@ -17,4 +19,5 @@
 USAGE
 
+# initialize the variables that will hold the arguments
 my $list = 0;
 my $add = "";
@@ -23,4 +26,5 @@
 my $default = "";
 
+# get the options from the command line
 GetOptions ('l|list' => \$list,
 	    's|set-default=s' => \$default,
@@ -29,23 +33,37 @@
 	    'h|host=s' => \$host);
 
+# set the path where the configuration files live
 my $configpath = "$ENV{'HOME'}/.gutenbach";
 
+# if the configuration path doens't exist, then make it
 if (! -e $configpath) {
     mkdir "$configpath";
 }
-#set given queue to default
+
+# if the 'default' option was specified, then set given queue to
+# default
 if($default and !$add and !$delete and !$list) {
+    # if the specified queue doesn't exist, then throw an error
     unless(-e "$configpath/$default") {
 	print "Error: queue '$default' doesn't exist yet...you should add it first.\n";
 	exit 1;
     }
+    
+    # if there already exists a default, then remove it so we can
+    # replace it with the new default
     if( -e "$configpath/DEFAULT"){
 	unlink("$configpath/DEFAULT") or die "Couldn't remove config file '$configpath/DEFAULT'";
     }
+
+    # check to make sure we can create symlinks
     my $symlink_exists = eval { symlink("",""); 1 };
+
+    # if so, then create the symlink and report it
     if ($symlink_exists){
 	symlink("$configpath/$default","$configpath/DEFAULT");
 	print "Changed default queue to $default.\n";
     }
+
+    # otherwise, throw an error
     else
     {
@@ -54,11 +72,12 @@
     }
 }
-    
-	
 
-# list the existing queues
+# if the 'list' option was specified, then list the existing queues
 elsif ($list and !$add and !$delete and !$default) {
+    # get the config files in the configuration path -- these are the queues
     my @queues = glob("$configpath/*") or die "Couldn't find configuration files at '$configpath'";
 
+    # for each of the queues, load the configuration file and print
+    # the queue name and the host it's on
     print "Queue\t\tHost\n";
     foreach my $q (@queues) {
@@ -76,6 +95,9 @@
 }
 
-# add a new queue
+# if the 'add' option was specified, then add a new queue
 elsif (!$list and $add and !$delete) {
+
+    # make sure there was a host specified as well (otherwise, we
+    # won't know where to print to)
     if (!$host) {
 	print $usage;
@@ -83,8 +105,10 @@
     }
 
+    # if the queue already exists, then print a warning
     if (-e "$configpath/$add") {
 	print "Warning: queue '$add' already exists\n";
     }
 
+    # create the configuration file
     open CONFIG, "> $configpath/$add" or die "Couldn't open config file '$configpath/$add'";
     print CONFIG "\$host = \"$host\";\n";
@@ -95,14 +119,18 @@
 }
 
-# delete an existing queue
+# if the 'delete' option was specified, then delete an existing queue
 elsif (!$list and !$add and $delete) {
+
+    # if the queue doesn't exist, then print an error and exit
     if (! -e "$configpath/$delete") {
-	print "Error: queue '$delete' already exists\n";
+	print "Error: queue '$delete' does not exist\n";
 	exit 1;
     }
 
+    # otherwise, remove the configuration file
     unlink("$configpath/$delete") or die "Couldn't remove config file '$configpath/$delete'";
 }
 
+# otherwise, it's an unrecognized option, so print the usage and exit
 else {
     print $usage;
