changed !-z to -n for if buffer sizes if