Fixed bug in replaceLUT. Restructured findMux2