why does the which command output the same path twice?
which searches your PATH variable for instances of the program. With a -a option it lists all instances of the program's path. Your PATH variable has two instances of /usr/local/bin, that is why you see the program path listed twice.