Added 'ms_' to all function names, started wire sorting method