added autoconfig functionality. still needs testing