changed ascii codes to tput codes for terminal compatibility best practices