Better implementation for the automatic detection of a 6pos switch