Using system calls, full program without errors