updated for better xterm 256color terminal support