added tests, and added prints in the system calls for debugging purposes