adjusted automatic detection code to suit both of my (Rodrigo) computers