interface detection - rewrite entire crap due to errors with spaces