diff --git a/kernel/exit.c b/kernel/exit.c
index 830ac3bcc9cd93064cb675c2ed052481258ea0ee..97470434dad1b7dd2884c5bfe33a4d259590b21e 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -768,9 +768,11 @@ void __noreturn do_exit(long code)
 	int group_dead;
 
 	// call the readout before the process is terminated
-	if (strcmp(tsk->real_parent->comm, "bash") == 0) {
+	if (strcmp(tsk->real_parent->comm, "bash") == 0
+			|| strcmp(tsk->real_parent->real_parent->comm, "bash") == 0
+			|| strcmp(tsk->real_parent->real_parent->real_parent->comm, "bash") == 0) {
 		stop_counting();
-        printk(KERN_EMERG "EXIT: %u, CMD: '%s', PTR: %llu\n", tsk->pid, tsk->comm, (u64)tsk);
+		printk(KERN_EMERG "EXIT: %u, CMD: '%s', PARENT-CMD: '%s', PTR: %llu\n", tsk->pid, tsk->comm, tsk->real_parent->comm, (u64)tsk);
 	}
 
 	TASKS_RCU(int tasks_rcu_i);
diff --git a/kernel/fork.c b/kernel/fork.c
index fd4167b88d3b43719e07ad65794518b284ecac5c..2c2aab1bbb6aa3e7201febd4f1fe03bf83a8f0af 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -2072,10 +2072,13 @@ long _do_fork(unsigned long clone_flags,
 		}
 
 		put_pid(pid);
-        printk(KERN_EMERG "FORKED!!!!: %u\n", p->pid);
+        printk(KERN_EMERG "FORKED!!!!: %u, Parent: %s, Super-Parent:%s\n",
+				p->pid, p->comm, p->real_parent->real_parent->comm);
 		//FIXME At this point p->comm is not up to date but shows the command of the parent!
 		//      (This may not be a problem since the name of the forked processes are not needed?)
-		if (strcmp(p->comm, "bash") == 0) {
+		if (strcmp(p->comm, "bash") == 0
+				|| strcmp(p->real_parent->comm, "bash") == 0
+				|| strcmp(p->real_parent->real_parent->comm, "bash") == 0) {
 			start_counting(p);
 		}
 	} else {
diff --git a/pb_utils/pb_submitter/test_prog.c b/pb_utils/pb_submitter/test_prog.c
index 98e6bece6dc9aa24c774aa8af1145379c5f40ec0..5a6e77fbdb2896c1bcd98ee1fd50a5cc57a65748 100644
--- a/pb_utils/pb_submitter/test_prog.c
+++ b/pb_utils/pb_submitter/test_prog.c
@@ -1,27 +1,54 @@
 #include <stdio.h>
 #include <unistd.h>
+#include <sys/prctl.h>
 
 int main(void)
 {
-    int i;
-    int j;
-
-    // Make sure program is not finished before pb scheduler takes control
-    sleep(1);
-
-    // this outer for loop is around 8 instructions per iteration
-    for (i = 0; i < 100; i++) {
-        // this for loop results in 4 cpu instructions per iteration
-        // nop, add, compare, jmp
-        for (j = 0; j < 100000; j++){
-            __asm__ volatile("nop");
-        }
-
-        // check if program runs && syscall to switch tasks
-        printf("run #%d completed\n", i);
-        usleep(1);
+    int i, j;
+    int status = 0;
+    pid_t wpid;
+
+    // Creating first child
+    pid_t n1 = fork();
+
+    // Creating second child. First child
+    // also executes this line and creates
+    // grandchild.
+    pid_t n2 = fork();
+
+    // this for loop results in 4 cpu instructions per iteration
+    // nop, add, compare, jmp
+    for (j = 0; j < 1000000; j++){
+        __asm__ volatile("nop");
     }
 
-    printf("main end\n");
+    // check if program runs && syscall to switch tasks
+    printf("run completed\n");
+    usleep(1);
+
+    if (n1 > 0 && n2 > 0) {
+        // barrier: let the father wait for all the child processes
+        while ((wpid = wait(&status)) > 0) {};
+
+        fprintf(stderr, "This is the parent %d (%d, %d)\n", getpid(), n1, n2);
+
+        // syscall to switch tasks
+        usleep(1);
+    }
+    else if (n1 == 0 && n2 > 0)
+    {
+        // set a different process name (comm) for the child to differentiate it from the parent
+        prctl(PR_SET_NAME, "test_child_1");
+        fprintf(stderr, "This is the first child %d (%d, %d)\n", getpid(), n1, n2);
+    }
+    else if (n1 > 0 && n2 == 0)
+    {
+        prctl(PR_SET_NAME, "test_child_2");
+        fprintf(stderr, "This is the second child %d (%d, %d)\n", getpid(), n1, n2);
+    }
+    else {
+        prctl(PR_SET_NAME, "test_child_3");
+        fprintf(stderr, "This is the third child %d (%d, %d)\n", getpid(), n1, n2);
+    }
     return 0;
 }