Cleaned up code for "example progs"