now using basename() to get program name.