added function to print trapframe