Changed to the C printf and scanf instead of write and read functions