changed read/write syscall - apl