implemented write (console-only) syscall and more efficient printf